Skip to content

Commit 4896692

Browse files
committed
Build: handle possible corrupt state of library repo
1 parent 6971f0c commit 4896692

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

Build/Scripts/HYPRE/build_hypre.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ echo "Checking for hypre repository..."
3232
if [ -d "$FIREMODELS/hypre" ]; then
3333
echo "Hypre repository exists. Building hypre library."
3434
cd $FIREMODELS/hypre
35+
# Handle possible corrupted state of repository
36+
if git branch | grep -q "* master"; then
37+
echo "On master branch"
38+
else
39+
git checkout master
40+
fi
41+
git checkout .
42+
git clean -dxf
3543
if [[ "$(git tag -l $HYPRE_LIB_TAG)" == $HYPRE_LIB_TAG ]]; then
3644
echo "Checking out $HYPRE_LIB_TAG"
3745
git checkout $HYPRE_LIB_TAG

Build/Scripts/SUNDIALS/build_sundials.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ echo "Checking for sundials repository..."
3333
if [ -d "$FIREMODELS/sundials" ]; then
3434
echo "Sundials repository exists. Building sundials library."
3535
cd $FIREMODELS/sundials
36+
# Handle possible corrupted state of repository
37+
if git branch | grep -q "* main"; then
38+
echo "On main branch"
39+
else
40+
git checkout main
41+
fi
42+
git checkout .
43+
git clean -dxf
3644
if [[ "$(git tag -l $SUNDIALS_LIB_TAG)" == $SUNDIALS_LIB_TAG ]]; then
3745
echo "Checking out $SUNDIALS_LIB_TAG"
3846
git checkout $SUNDIALS_LIB_TAG

0 commit comments

Comments
 (0)