in src/shipit/phase/ShipItDeleteCorruptedRepoPhase.php [41:73]
protected async function genRunImpl(
ShipItManifest $manifest,
): Awaitable<void> {
$local_path = $this->side === ShipItRepoSide::SOURCE
? $manifest->getSourcePath()
: $manifest->getDestinationPath();
if (!PHP\file_exists($local_path)) {
return;
}
if (!(await $this->genIsCorrupted($local_path))) {
return;
}
ShipItLogger::err(" Corruption detected, re-cloning\n");
$path = PHP\dirname($local_path);
if (Str\contains(PHP\php_uname('s'), 'Darwin')) {
// MacOS doesn't have GNU rm
await (new ShipItShellCommand($path, 'rm', '-rf', $local_path))->genRun();
} else {
await (
new ShipItShellCommand(
$path,
'rm',
'-rf',
'--preserve-root',
$local_path,
)
)
->genRun();
}
}