Skip to content

Commit 7ae3428

Browse files
fix: Fixed to support better other branches
1 parent 2066814 commit 7ae3428

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

tests/CI/build_diracx.sh

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,30 +28,26 @@ if [[ "$DIRACX_REPO" =~ ^https?:// ]]; then
2828
if [[ -d "$TMP_CLONE_DIR" ]]; then
2929
echo "DiracX installation already done and FORCE=0. Skipping build and clone."
3030
else
31-
mkdir -p "$TMP_CLONE_DIR"
3231
echo "Cloning DiracX from remote..."
3332
rm -rf "$TMP_CLONE_DIR"
34-
git clone --single-branch "$DIRACX_REPO" "$TMP_CLONE_DIR"
33+
if [ -n "$DIRACX_BRANCH" ]; then
34+
git clone --branch "$DIRACX_BRANCH" "$DIRACX_REPO" "$TMP_CLONE_DIR"
35+
else
36+
git clone "$DIRACX_REPO" "$TMP_CLONE_DIR"
37+
cd "$TMP_CLONE_DIR"
38+
tag=$(git describe --tags "$(git rev-list --tags --max-count=1)")
39+
echo "No branch specified, defaulting on the last tag: $tag"
40+
git checkout "$tag"
41+
cd "$OLD_PWD"
42+
fi
3543
fi
3644

3745
DIRACX_REPO="$TMP_CLONE_DIR"
38-
39-
if [ -n "$DIRACX_BRANCH" ]; then
40-
cd "$DIRACX_REPO"
41-
git checkout "$DIRACX_BRANCH"
42-
echo "Moved to branch $DIRACX_BRANCH"
43-
cd "$OLD_PWD"
44-
else
45-
cd "$DIRACX_REPO"
46-
tag=$(git describe --tags "$(git rev-list --tags --max-count=1)")
47-
echo "No branch specified, defaulting on the last tag."
48-
git checkout "$tag"
49-
cd "$OLD_PWD"
50-
fi
5146
else
5247
echo "Using local DiracX."
5348
fi
5449

50+
5551
echo "DiracX is setup. Working on the dist folder..."
5652

5753
# Handle output directory

0 commit comments

Comments
 (0)