@ -101,7 +101,9 @@ class FileDownloader implements DownloaderInterface
*/
public function remove(PackageInterface $package, $path)
{
$this->filesystem->removeDirectory($path);
if (!$this->filesystem->removeDirectory($path)) {
throw new \RuntimeException('Could not completely delete '.$path.', aborting.');
}
/**
@ -77,7 +77,9 @@ abstract class VcsDownloader implements DownloaderInterface
$this->enforceCleanDirectory($path);
@ -34,7 +34,7 @@ class Filesystem
// clear stat cache because external processes aren't tracked by the php stat cache
clearstatcache();
return $result;
return $result && !is_dir($directory);
public function ensureDirectoryExists($directory)