From d24a4d223125f9d2574eb605f4f67a861da581bb Mon Sep 17 00:00:00 2001 From: Brian Clark Date: Fri, 12 Jun 2020 22:09:31 -0400 Subject: [PATCH] Checkout branch if specified --- setup | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/setup b/setup index 6f5305b..0e5c7e5 100755 --- a/setup +++ b/setup @@ -353,12 +353,17 @@ install_repos() { continue fi + ## Check out desired branch + if [[ -v repo[branch ]]; then + run "cd ${target}; git checkout ${repo[branch]}" + fi + # Handle submodules run "cd ${target}; git submodule update --init --recursive" ; run "cd ${target}; git submodule foreach --recursive git checkout master" # Execute any post-install script - if [[ -n "${repo[script]}" ]]; then + if [[ -v repo[script] ]]; then run "( cd ${target} ; ${repo[script]} )" fi done