Skip to content

Commit

Permalink
Fix unlink(folder) failure on Windows using removeDirectory()
Browse files Browse the repository at this point in the history
  • Loading branch information
johnstevenson committed Jan 28, 2013
1 parent f677549 commit ff1cf15
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Composer/Factory.php
Expand Up @@ -17,6 +17,7 @@
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;
Expand Down Expand Up @@ -86,6 +87,7 @@ public static function createConfig()
'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);
Expand All @@ -105,7 +107,7 @@ public static function createConfig()
@rename($child, $dir.'/'.basename($child));
}
}
@unlink($oldPath);
$filesystem->removeDirectory($oldPath);
}
}
}
Expand Down

0 comments on commit ff1cf15

Please sign in to comment.