Skip to content

Commit 3017790

Browse files
committed
Fix empty host in init command
1 parent 079f6e4 commit 3017790

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Command/InitCommand.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,12 @@ protected function execute(InputInterface $input, OutputInterface $output): int
107107
if (isset($tempHostFile)) {
108108
$host = file_get_contents($tempHostFile);
109109
}
110-
$hosts = explode(',', $io->ask('Hosts (comma separated)', $host));
110+
$hostsString = $io->ask('Hosts (comma separated)', $host);
111+
if ($hostsString !== null) {
112+
$hosts = explode(',', $hostsString);
113+
} else {
114+
$hosts = [];
115+
}
111116

112117
file_put_contents($recipePath, $this->$language($template, $project, $repository, $hosts));
113118

0 commit comments

Comments
 (0)