From 4384f1bbd729b379a45d6a35f722e12f3c654060 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Sun, 14 Apr 2013 19:06:40 -0700 Subject: [PATCH] givi - Add "--setup" and "--gencode" options --- bin/givi | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/bin/givi b/bin/givi index b99b60029a..23275c26b1 100755 --- a/bin/givi +++ b/bin/givi @@ -79,6 +79,16 @@ class Givi { */ protected $repos; + /** + * @var bool + */ + protected $useGencode = FALSE; + + /** + * @var bool + */ + protected $useSetup = FALSE; + /** * @var array, non-hyphenated arguments after the basedir */ @@ -158,6 +168,13 @@ class Givi { return $this->returnError("unrecognized action: {$this->action}\n"); } + if ($this->useSetup) { + $this->run('core', $this->civiRoot . '/bin', 'bash', 'setup.sh'); + } + elseif ($this->useGencode) { + $this->run('core', $this->civiRoot . '/xml', 'php', 'GenCode.php'); + } + $this->dirStack->pop(); } @@ -179,6 +196,12 @@ class Givi { elseif ($arg == '--dry-run' || $arg == '-n') { $this->dryRun = TRUE; } + elseif ($arg == '--gencode') { + $this->useGencode = TRUE; + } + elseif ($arg == '--setup') { + $this->useSetup = TRUE; + } elseif (preg_match('/^--d([678])/', $arg, $matches)) { $this->drupalVersion = $matches[1]; } @@ -236,6 +259,8 @@ class Givi { 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)"; echo " --root=X: Specify CiviCRM root directory (default: .)\n"; + echo " --gencode: Run xml/GenCode after checking out code\n"; + echo " --setup: Run bin/setup.sh (incl xml/GenCode) after checking out code\n"; 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"; -- 2.25.1