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

main
Jordi Boggiano 4 years ago
parent 919fa60579
commit 5d970022e8
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC

@ -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.');

Loading…
Cancel
Save