Fix dep init outside of git (#2338)

If it is set to null, an error will occur in other processing,
 so it was initialized with an empty string.

SymfonyStyle#ask is v5 with type-hint added.
`$default` is ?string so bool is not acceptable.

https://github.com/symfony/symfony/blob/5.x/src/Symfony/Component/Console/Style/SymfonyStyle.php#L267
This commit is contained in:
Hiroshi Onozaki 2020-12-08 18:06:26 +09:00 committed by GitHub
parent 9296a5acc8
commit 52414d9b19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -61,7 +61,7 @@ class InitCommand extends Command
$template = $io->choice('Select project template', $this->recipes(), 'common');
// Repo
$default = false;
$default = '';
try {
$process = Process::fromShellCommandline('git remote get-url origin');
$default = $process->mustRun()->getOutput();
@ -86,7 +86,7 @@ class InitCommand extends Command
}
// Project
$default = false;
$default = '';
try {
$process = Process::fromShellCommandline('basename "$PWD"');
$default = $process->mustRun()->getOutput();