Skip to content

Commit b26edc7

Browse files
committed
properly comparing new/old config arrays
1 parent eef25f7 commit b26edc7

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/PatternLab/Config.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -326,14 +326,17 @@ public static function updateConfigOption($optionName,$optionValue, $force = fal
326326

327327
// standardize the values for comparison
328328
$currentOption = self::getOption($optionName);
329-
$currentOptionValue = is_array($currentOption) ? implode(", ",$currentOption) : $currentOption;
330-
$newOptionValue = is_array($optionValue) ? implode(", ",$optionValue) : $optionValue;
329+
$currentOptionValue = $currentOption;
330+
$newOptionValue = $optionValue;
331331

332332
if ($currentOptionValue != $newOptionValue) {
333333

334334
// prompt for input
335-
$prompt = "update the config option <desc>".$optionName." (".$currentOptionValue.")</desc> with the value <desc>".$newOptionValue."</desc>?";
336-
$options = "Y/n";
335+
if (is_array($currentOptionValue)) {
336+
$prompt = "update the config option <desc>".$optionName."</desc> with the value from the package install?";
337+
} else {
338+
$prompt = "update the config option <desc>".$optionName." (".$currentOptionValue.")</desc> with the value <desc>".$newOptionValue."</desc>?";
339+
}$options = "Y/n";
337340
$input = Console::promptInput($prompt,$options,"Y");
338341

339342
if ($input == "y") {

0 commit comments

Comments
 (0)