Skip to content

Commit

Permalink
Fix resolution of variable name during variable:create --update (#1426)
Browse files Browse the repository at this point in the history
  • Loading branch information
pjcdawkins authored Mar 20, 2024
1 parent d70e3f6 commit f5b7f32
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/Command/Variable/VariableCreateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,15 @@ protected function execute(InputInterface $input, OutputInterface $output)
$arguments = [
'--allow-no-change' => true,
'--project' => $this->getSelectedProject()->id,
'name' => $name,
];
if ($this->hasSelectedEnvironment()) {
$arguments['--environment'] = $this->getSelectedEnvironment()->id;
}
foreach ($this->form->getFields() as $field) {
$value = $field->getValueFromInput($input, false);
$argName = '--' . $field->getOptionName();
if ($argName === '--name') {
$argName = 'name';
}
if ($value !== null && !in_array($argName, ['--level', '--prefix'])) {
$value = $field->getValueFromInput($input, false);
if ($value !== null && !in_array($argName, ['--name', '--level', '--prefix'])) {
$arguments[$argName] = $value;
}
}
Expand Down

0 comments on commit f5b7f32

Please sign in to comment.