Skip to content

Commit 132cb86

Browse files
committed
add a 'force update' option
1 parent 2f40745 commit 132cb86

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/PatternLab/Config.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,9 @@ public static function setExposedOption($optionName = "") {
283283
* Update a single config option based on a change in composer.json
284284
* @param {String} the name of the option to be changed
285285
* @param {String} the new value of the option to be changed
286+
* @param {Boolean} whether to force the update of the option
286287
*/
287-
public static function updateConfigOption($optionName,$optionValue) {
288+
public static function updateConfigOption($optionName,$optionValue, $force = false) {
288289

289290
if (is_string($optionValue) && strpos($optionValue,"<prompt>") !== false) {
290291

@@ -296,7 +297,7 @@ public static function updateConfigOption($optionName,$optionValue) {
296297
self::writeUpdateConfigOption($optionName,$input);
297298
Console::writeTag("ok","config option ".$optionName." updated...", false, true);
298299

299-
} else if (!isset(self::$options[$optionName]) || (self::$options["overrideConfig"] == "a")) {
300+
} else if (!isset(self::$options[$optionName]) || (self::$options["overrideConfig"] == "a") || $force) {
300301

301302
// if the option isn't set or the config is always to override update the config
302303
self::writeUpdateConfigOption($optionName,$optionValue);

0 commit comments

Comments
 (0)