✨ Ask for target directory when using `create-project`
parent
86ff43d8b9
commit
a66db48673
|
@ -748,6 +748,7 @@ By default the command checks for the packages on packagist.org.
|
||||||
* **--ignore-platform-req:** ignore a specific platform requirement(`php`,
|
* **--ignore-platform-req:** ignore a specific platform requirement(`php`,
|
||||||
`hhvm`, `lib-*` and `ext-*`) and force the installation even if the local machine
|
`hhvm`, `lib-*` and `ext-*`) and force the installation even if the local machine
|
||||||
does not fulfill it.
|
does not fulfill it.
|
||||||
|
* **--ask:** Ask user to provide target directory for new project.
|
||||||
|
|
||||||
## dump-autoload (dumpautoload)
|
## dump-autoload (dumpautoload)
|
||||||
|
|
||||||
|
|
|
@ -84,6 +84,7 @@ class CreateProjectCommand extends BaseCommand
|
||||||
new InputOption('no-install', null, InputOption::VALUE_NONE, 'Whether to skip installation of the package dependencies.'),
|
new InputOption('no-install', null, InputOption::VALUE_NONE, 'Whether to skip installation of the package dependencies.'),
|
||||||
new InputOption('ignore-platform-req', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Ignore a specific platform requirement (php & ext- packages).'),
|
new InputOption('ignore-platform-req', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Ignore a specific platform requirement (php & ext- packages).'),
|
||||||
new InputOption('ignore-platform-reqs', null, InputOption::VALUE_NONE, 'Ignore all platform requirements (php & ext- packages).'),
|
new InputOption('ignore-platform-reqs', null, InputOption::VALUE_NONE, 'Ignore all platform requirements (php & ext- packages).'),
|
||||||
|
new InputOption('ask', null, InputOption::VALUE_NONE, 'Whether to ask for project directory.'),
|
||||||
))
|
))
|
||||||
->setHelp(
|
->setHelp(
|
||||||
<<<EOT
|
<<<EOT
|
||||||
|
@ -130,6 +131,10 @@ EOT
|
||||||
$input->setOption('no-plugins', true);
|
$input->setOption('no-plugins', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($input->isInteractive() && $input->getOption('ask')) {
|
||||||
|
$input->setArgument('directory', $io->ask('New project directory <comment>[optional]</comment>: '));
|
||||||
|
}
|
||||||
|
|
||||||
$ignorePlatformReqs = $input->getOption('ignore-platform-reqs') ?: ($input->getOption('ignore-platform-req') ?: false);
|
$ignorePlatformReqs = $input->getOption('ignore-platform-reqs') ?: ($input->getOption('ignore-platform-req') ?: false);
|
||||||
|
|
||||||
return $this->installProject(
|
return $this->installProject(
|
||||||
|
|
Loading…
Reference in New Issue