Browse Source

Chore: Use consistent directory path

Only when a install directory was not specified, was the CWD prepended to `$directory`. This change provides consistency in paths displayed to the user.
polarathene 5 years ago
parent
commit
43e0321ee7
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/Composer/Command/CreateProjectCommand.php

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

@@ -282,9 +282,10 @@ EOT
         // if no directory was specified, use the 2nd part of the package name
         if (null === $directory) {
             $parts = explode("/", $name, 2);
-            $directory = getcwd() . DIRECTORY_SEPARATOR . array_pop($parts);
+            $directory = array_pop($parts);
         }
 
+        $directory = getcwd() . DIRECTORY_SEPARATOR . $directory;
         $io->writeError('<info>Creating a "' . $packageName . '" project at "' . $directory . '"</info>');
 
         $fs = new Filesystem();