From 0a03e42f935c343fb1afb9b689233d625043f239 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Mon, 29 Aug 2016 17:15:13 -0700 Subject: [PATCH] bin/givi - Add backdrop support This script is little-used but sometimes helpful when juggling multiple versions in the same source-tree. --- bin/givi | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bin/givi b/bin/givi index 727227b93e..7784963159 100755 --- a/bin/givi +++ b/bin/givi @@ -188,6 +188,7 @@ class Givi { $this->dirStack = new DirStack(); $this->repos = array( 'core' => '.', + 'backdrop' => 'backdrop', 'drupal' => 'drupal', 'joomla' => 'joomla', 'packages' => 'packages', @@ -302,7 +303,7 @@ class Givi { elseif (preg_match('/^--repos=(.*)/', $arg, $matches)) { $this->repoFilter = $matches[1]; } - elseif (preg_match('/^--(core|packages|joomla|drupal|wordpress)=(.*)/', $arg, $matches)) { + elseif (preg_match('/^--(core|packages|joomla|drupal|wordpress|backdrop)=(.*)/', $arg, $matches)) { $this->branches[$matches[1]] = $matches[2]; } elseif (preg_match('/^-/', $arg)) { @@ -350,6 +351,7 @@ class Givi { echo " --dry-run: Don't do anything; only print commands that would be run\n"; echo " --d6: Specify that Drupal branches should use 6.x-* prefixes\n"; echo " --d7: Specify that Drupal branches should use 7.x-* prefixes (default)\n"; + echo " --d8: Specify that Drupal branches should use 8.x-* prefixes\n"; echo " -f: When switching branches, proceed even if the index or the working tree differs from HEAD. This is used to throw away local changes.\n"; echo " --fetch: Fetch the latest code before creating, updating, or checking-out anything\n"; echo " --repos=X: Restrict operations to the listed repos (comma-delimited list) (default: all)"; @@ -359,6 +361,7 @@ class Givi { echo "Special options:\n"; echo " --core=X: Specify the branch to use on the core repository\n"; echo " --packages=X: Specify the branch to use on the packages repository\n"; + echo " --backdrop=X: Specify the branch to use on the backdrop repository\n"; echo " --drupal=X: Specify the branch to use on the drupal repository\n"; echo " --joomla=X: Specify the branch to use on the joomla repository\n"; echo " --wordpress=X: Specify the branch to use on the wordpress repository\n"; @@ -679,6 +682,12 @@ class Givi { array_push($parts, $last); return implode('/', $parts); } + if ($repoName == 'backdrop') { + $parts = explode('/', $branchName); + $last = '1.x-' . array_pop($parts); + array_push($parts, $last); + return implode('/', $parts); + } return $branchName; } -- 2.25.1