فهرست منبع

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

Ulrich Kautz 12 سال پیش
والد
کامیت
051118c500
1فایلهای تغییر یافته به همراه2 افزوده شده و 0 حذف شده
  1. 2 0
      src/Composer/Command/CreateProjectCommand.php

+ 2 - 0
src/Composer/Command/CreateProjectCommand.php

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