Try twice to remove a directory on windows because sometimes it fails due to temporary locks
parent
908d2d91da
commit
2d40e14985
|
@ -171,9 +171,12 @@ class FileDownloader implements DownloaderInterface
|
||||||
{
|
{
|
||||||
$this->io->write(" - Removing <info>" . $package->getName() . "</info> (<comment>" . VersionParser::formatVersion($package) . "</comment>)");
|
$this->io->write(" - Removing <info>" . $package->getName() . "</info> (<comment>" . VersionParser::formatVersion($package) . "</comment>)");
|
||||||
if (!$this->filesystem->removeDirectory($path)) {
|
if (!$this->filesystem->removeDirectory($path)) {
|
||||||
|
// retry after a bit on windows since it tends to be touchy with mass removals
|
||||||
|
if (!defined('PHP_WINDOWS_VERSION_BUILD') || (usleep(250) && !$this->filesystem->removeDirectory($path))) {
|
||||||
throw new \RuntimeException('Could not completely delete '.$path.', aborting.');
|
throw new \RuntimeException('Could not completely delete '.$path.', aborting.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets file name for specific package
|
* Gets file name for specific package
|
||||||
|
|
|
@ -128,9 +128,12 @@ abstract class VcsDownloader implements DownloaderInterface
|
||||||
$this->io->write(" - Removing <info>" . $package->getName() . "</info> (<comment>" . $package->getPrettyVersion() . "</comment>)");
|
$this->io->write(" - Removing <info>" . $package->getName() . "</info> (<comment>" . $package->getPrettyVersion() . "</comment>)");
|
||||||
$this->cleanChanges($path, false);
|
$this->cleanChanges($path, false);
|
||||||
if (!$this->filesystem->removeDirectory($path)) {
|
if (!$this->filesystem->removeDirectory($path)) {
|
||||||
|
// retry after a bit on windows since it tends to be touchy with mass removals
|
||||||
|
if (!defined('PHP_WINDOWS_VERSION_BUILD') || (usleep(250) && !$this->filesystem->removeDirectory($path))) {
|
||||||
throw new \RuntimeException('Could not completely delete '.$path.', aborting.');
|
throw new \RuntimeException('Could not completely delete '.$path.', aborting.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Download progress information is not available for all VCS downloaders.
|
* Download progress information is not available for all VCS downloaders.
|
||||||
|
|
Loading…
Reference in New Issue