From ad5b7b3950ee021f7077fa9d25cda8a33e97bbb6 Mon Sep 17 00:00:00 2001 From: Stephan Maximilian Huber Date: Fri, 21 Apr 2017 22:26:12 +0200 Subject: [PATCH] Introduce new config-option 'existingPathsPolicy' to prevent keyboard input. Possible values are 'merge' and 'replace' --- src/PatternLab/InstallerUtil.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/PatternLab/InstallerUtil.php b/src/PatternLab/InstallerUtil.php index fcc7fa99..ec67ba02 100644 --- a/src/PatternLab/InstallerUtil.php +++ b/src/PatternLab/InstallerUtil.php @@ -483,7 +483,15 @@ protected static function pathExists($packageName,$path) { } if ($prompt) { - + + + $existing_paths_policy = Config::getOption("existingPathsPolicy"); + if ($existing_paths_policy == 'merge') { + return false; + } + else if ($existing_paths_policy == 'replace') { + return true; + } // prompt for input using the supplied query $prompt = "the path ".$humanReadablePath." already exists. merge or replace with the contents of ".$packageName." package?"; $options = "M/r";