Task: #53687 Support instance-specific cfg write targets and add coverage V2 #4
1 changed files with 16 additions and 15 deletions
style: fix indentation
commit
56872a04c4
31
bin/cfg
31
bin/cfg
|
|
@ -379,21 +379,22 @@ case 'show':
|
||||||
echo $out.PHP_EOL;
|
echo $out.PHP_EOL;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'write':
|
case 'write':
|
||||||
|
alejandro.sosa marked this conversation as resolved
Outdated
|
|||||||
$inputPayload = $argv->find('in');
|
$inputPayload = $argv->find('in');
|
||||||
if (!$inputPayload && $settings['key'] === '')
|
if (!$inputPayload && $settings['key'] === '')
|
||||||
{
|
{
|
||||||
fwrite(STDERR, 'Nothing to write: provide SETTING or --in.'.PHP_EOL);
|
fwrite(STDERR, 'Nothing to write: provide SETTING or --in.'.PHP_EOL);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
$path = ($settings['key'] !== '') ? explode(':', $settings['key']) : [];
|
$path = ($settings['key'] !== '') ? explode(':', $settings['key']) : [];
|
||||||
verboseLog($verbose, 'write source: '.($inputPayload ? '--in' : 'SETTING'));
|
verboseLog($verbose, 'write source: '.($inputPayload ? '--in' : 'SETTING'));
|
||||||
if ($inputPayload)
|
|
||||||
{
|
if ($inputPayload)
|
||||||
$setting2write = $inputPayload;
|
{
|
||||||
}
|
$setting2write = $inputPayload;
|
||||||
else
|
}
|
||||||
{
|
else
|
||||||
|
{
|
||||||
$setting2write = $settings['value'];
|
$setting2write = $settings['value'];
|
||||||
}
|
}
|
||||||
verboseLog($verbose, 'write path: '.json_encode($path));
|
verboseLog($verbose, 'write path: '.json_encode($path));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue
probably this one too?