1
0
Fork 0

Fix unlink(folder) failure on Windows using removeDirectory()

pull/1535/head
johnstevenson 2013-01-28 15:38:50 +00:00
parent f67754997b
commit ff1cf15cb4
1 changed files with 3 additions and 1 deletions

View File

@ -17,6 +17,7 @@ use Composer\Json\JsonFile;
use Composer\IO\IOInterface;
use Composer\Repository\ComposerRepository;
use Composer\Repository\RepositoryManager;
use Composer\Util\Filesystem;
use Composer\Util\ProcessExecutor;
use Composer\Util\RemoteFilesystem;
use Symfony\Component\Console\Formatter\OutputFormatterStyle;
@ -86,6 +87,7 @@ class Factory
'cache-vcs-dir' => array('/cache.git' => '/*', '/cache.hg' => '/*'),
'cache-files-dir' => array('/cache.files' => '/*'),
);
$filesystem = new Filesystem();
foreach ($legacyPaths as $key => $oldPaths) {
foreach ($oldPaths as $oldPath => $match) {
$dir = $config->get($key);
@ -105,7 +107,7 @@ class Factory
@rename($child, $dir.'/'.basename($child));
}
}
@unlink($oldPath);
$filesystem->removeDirectory($oldPath);
}
}
}