|
|
@@ -60,7 +60,13 @@ class SetupEnvCommand extends Command
|
|
|
|
|
|
protected function execute(InputInterface $input, OutputInterface $output): int
|
|
|
{
|
|
|
- $hostname = $input->getOption('host') ?? gethostname();
|
|
|
+ if ($input->getOption('host')) {
|
|
|
+ $hostname = $input->getOption('host');
|
|
|
+ } else if (getenv('HOST')) {
|
|
|
+ $hostname = getenv('HOST');
|
|
|
+ } else {
|
|
|
+ $hostname = gethostname();
|
|
|
+ }
|
|
|
|
|
|
if (!array_key_exists($hostname, self::ENVIRONMENTS_FILES)) {
|
|
|
throw new \RuntimeException("Critical : unknown environment [" . $hostname . "]");
|