1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-11 09:32:55 +00:00

Check for necessity of VCS cleanup when --prefer-dist is used (only project package, so far)

This commit is contained in:
Ulrich Kautz 2012-10-19 12:56:59 +02:00
parent 4f4cbc17d9
commit 051118c500

View file

@ -169,6 +169,7 @@ EOT
if ($package->getRepository() instanceof NotifiableRepositoryInterface) {
$package->getRepository()->notifyInstall($package);
}
$installedFromVcs = 'source' === $package->getInstallationSource();
$io->write('<info>Created project in ' . $directory . '</info>');
chdir($directory);
@ -197,6 +198,7 @@ EOT
!$io->isInteractive() ||
$io->askConfirmation('<info>Do you want to remove the exisitng VCS (.git, .svn..) history?</info> [<comment>Y,n</comment>]? ', true)
)
&& (!$preferDist || $installedFromVcs)
) {
$finder = new Finder();
$finder->depth(1)->directories()->in(getcwd())->ignoreVCS(false)->ignoreDotFiles(false);