From 12a767ba1cf6a5ad7dbde0b21172f7cfb6e5f850 Mon Sep 17 00:00:00 2001
From: Whitney Armstrong <warmstrong@anl.gov>
Date: Sat, 27 Feb 2021 19:52:58 -0600
Subject: [PATCH] Added JUGGLER_DETECTOR_VERSION to clone specific branch

- This can be a tag or a branch (uses `git clone -b X`)
---
 options/env.sh         | 5 +++++
 util/build_detector.sh | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/options/env.sh b/options/env.sh
index 542ee7de..f696b394 100755
--- a/options/env.sh
+++ b/options/env.sh
@@ -34,6 +34,11 @@ if [ ! -n  "${JUGGLER_DETECTOR}" ] ; then
 fi
 echo "JUGGLER_DETECTOR:       ${JUGGLER_DETECTOR}"
 
+if [ ! -n  "${JUGGLER_DETECTOR_VERSION}" ] ; then 
+  export JUGGLER_DETECTOR_VERSION="v0.0.1"
+fi
+echo "JUGGLER_DETECTOR_VERSION:       ${JUGGLER_DETECTOR_VERSION}"
+
 ## Number of events that will be processed by the reconstruction
 if [ ! -n  "${JUGGLER_N_EVENTS}" ] ; then 
   export JUGGLER_N_EVENTS=100
diff --git a/util/build_detector.sh b/util/build_detector.sh
index 02313585..bccf765b 100755
--- a/util/build_detector.sh
+++ b/util/build_detector.sh
@@ -29,7 +29,7 @@ pushd ${DETECTOR_PREFIX}
 ## We need an up-to-date copy of the detector
 if [ ! -d ${JUGGLER_DETECTOR} ]; then
   echo "Fetching ${JUGGLER_DETECTOR}"
-  git clone https://eicweb.phy.anl.gov/EIC/detectors/${JUGGLER_DETECTOR}.git
+  git clone -b ${JUGGLER_DETECTOR_VERSION} https://eicweb.phy.anl.gov/EIC/detectors/${JUGGLER_DETECTOR}.git
 else
   echo "Updating ${JUGGLER_DETECTOR}"
   pushd ${JUGGLER_DETECTOR}
-- 
GitLab