Forráskód Böngészése

Normalize output of create-project target path, refs #8609, refs #8412

Jordi Boggiano 5 éve
szülő
commit
5d970022e8
1 módosított fájl, 6 hozzáadás és 2 törlés
  1. 6 2
      src/Composer/Command/CreateProjectCommand.php

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

@@ -305,9 +305,13 @@ EOT
             $directory = getcwd() . DIRECTORY_SEPARATOR . array_pop($parts);
         }
 
-        $io->writeError('<info>Creating a "' . $packageName . '" project at "' . $directory . '"</info>');
-
         $fs = new Filesystem();
+        if (!$fs->isAbsolutePath($directory)) {
+            $directory = getcwd() . DIRECTORY_SEPARATOR . $directory;
+        }
+
+        $io->writeError('<info>Creating a "' . $packageName . '" project at "' . $fs->findShortestPath(getcwd(), $directory, true) . '"</info>');
+
         if (file_exists($directory)) {
             if (!is_dir($directory)) {
                 throw new \InvalidArgumentException('Cannot create project directory at "'.$directory.'", it exists as a file.');