mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-18 19:40:55 +01:00
Improve bin/config set
errors for complex values
Summary: - Fix missing space before "For example:". - Fix instruction to run `bin/config set value` instead of `bin/config set key value`. - Minor cleanup. Test Plan: Tried to set `files.image-mime-types`, `load-libraries`. Reviewers: chad Reviewed By: chad Differential Revision: https://secure.phabricator.com/D14080
This commit is contained in:
parent
6915011067
commit
7425407c12
2 changed files with 24 additions and 14 deletions
|
@ -7,7 +7,7 @@
|
||||||
*/
|
*/
|
||||||
return array(
|
return array(
|
||||||
'names' => array(
|
'names' => array(
|
||||||
'core.pkg.css' => 'e9f745e2',
|
'core.pkg.css' => '3fcfaed8',
|
||||||
'core.pkg.js' => '47dc9ebb',
|
'core.pkg.js' => '47dc9ebb',
|
||||||
'darkconsole.pkg.js' => 'e7393ebb',
|
'darkconsole.pkg.js' => 'e7393ebb',
|
||||||
'differential.pkg.css' => '2de124c9',
|
'differential.pkg.css' => '2de124c9',
|
||||||
|
@ -104,7 +104,7 @@ return array(
|
||||||
'rsrc/css/application/tokens/tokens.css' => '3d0f239e',
|
'rsrc/css/application/tokens/tokens.css' => '3d0f239e',
|
||||||
'rsrc/css/application/uiexample/example.css' => '528b19de',
|
'rsrc/css/application/uiexample/example.css' => '528b19de',
|
||||||
'rsrc/css/core/core.css' => 'a76cefc9',
|
'rsrc/css/core/core.css' => 'a76cefc9',
|
||||||
'rsrc/css/core/remarkup.css' => 'ef286a6e',
|
'rsrc/css/core/remarkup.css' => '1c4ac273',
|
||||||
'rsrc/css/core/syntax.css' => '9fd11da8',
|
'rsrc/css/core/syntax.css' => '9fd11da8',
|
||||||
'rsrc/css/core/z-index.css' => '57ddcaa2',
|
'rsrc/css/core/z-index.css' => '57ddcaa2',
|
||||||
'rsrc/css/diviner/diviner-shared.css' => '5a337049',
|
'rsrc/css/diviner/diviner-shared.css' => '5a337049',
|
||||||
|
@ -737,7 +737,7 @@ return array(
|
||||||
'phabricator-object-selector-css' => '85ee8ce6',
|
'phabricator-object-selector-css' => '85ee8ce6',
|
||||||
'phabricator-phtize' => 'd254d646',
|
'phabricator-phtize' => 'd254d646',
|
||||||
'phabricator-prefab' => '6920d200',
|
'phabricator-prefab' => '6920d200',
|
||||||
'phabricator-remarkup-css' => 'ef286a6e',
|
'phabricator-remarkup-css' => '1c4ac273',
|
||||||
'phabricator-search-results-css' => '7dea472c',
|
'phabricator-search-results-css' => '7dea472c',
|
||||||
'phabricator-shaped-request' => '7cbe244b',
|
'phabricator-shaped-request' => '7cbe244b',
|
||||||
'phabricator-side-menu-view-css' => 'bec2458e',
|
'phabricator-side-menu-view-css' => 'bec2458e',
|
||||||
|
|
|
@ -96,25 +96,35 @@ final class PhabricatorConfigManagementSetWorkflow
|
||||||
if (!is_array($value)) {
|
if (!is_array($value)) {
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case 'set':
|
case 'set':
|
||||||
|
$command = csprintf(
|
||||||
|
'./bin/config set %R %s',
|
||||||
|
$key,
|
||||||
|
'{"value1": true, "value2": true}');
|
||||||
|
|
||||||
$message = sprintf(
|
$message = sprintf(
|
||||||
"%s%s\n\n %s\n",
|
"%s\n\n %s\n",
|
||||||
pht(
|
pht(
|
||||||
"Config key '%s' is of type '%s'. Specify it in JSON.",
|
'Config key "%s" is of type "%s". Specify it in JSON. '.
|
||||||
$key,
|
'For example:',
|
||||||
$type),
|
$key,
|
||||||
pht('For example:'),
|
$type),
|
||||||
'./bin/config set \'{"value1": true, "value2": true}\'');
|
$command);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (preg_match('/^list</', $type)) {
|
if (preg_match('/^list</', $type)) {
|
||||||
|
$command = csprintf(
|
||||||
|
'./bin/config set %R %s',
|
||||||
|
$key,
|
||||||
|
'["a", "b", "c"]');
|
||||||
|
|
||||||
$message = sprintf(
|
$message = sprintf(
|
||||||
"%s%s\n\n %s\n",
|
"%s\n\n %s\n",
|
||||||
pht(
|
pht(
|
||||||
"Config key '%s' is of type '%s'. Specify it in JSON.",
|
'Config key "%s" is of type "%s". Specify it in JSON. '.
|
||||||
|
'For example:',
|
||||||
$key,
|
$key,
|
||||||
$type),
|
$type),
|
||||||
pht('For example:'),
|
$command);
|
||||||
'./bin/config set \'["a", "b", "c"]\'');
|
|
||||||
} else {
|
} else {
|
||||||
$message = pht(
|
$message = pht(
|
||||||
'Config key "%s" is of type "%s". Specify it in JSON.',
|
'Config key "%s" is of type "%s". Specify it in JSON.',
|
||||||
|
|
Loading…
Reference in a new issue