Skip to content

Commit c7f1180

Browse files
authored
[Bugfix:System] Bubble errors in install script (#8)
1 parent 4485b4b commit c7f1180

1 file changed

Lines changed: 15 additions & 11 deletions

File tree

install_analysistoolsts.sh

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env bash
22

3+
set -e
4+
35
########################################################################################################################
46
########################################################################################################################
57
# this script must be run by root or sudo
@@ -41,20 +43,22 @@ do
4143
if [ -d "${dir}" ]; then
4244
echo "pulling changes ..."
4345
# IF THE REPO ALREADY EXISTS...
44-
pushd "${dir}" || exit
46+
pushd "${dir}"
47+
48+
CURRENT_BRANCH=$(git branch --show-current)
4549

4650
# PULL CHANGES
4751
git fetch
4852
git reset --hard HEAD
49-
git merge origin/"$CURRENT_BRANCH"
50-
popd || exit
53+
git merge origin/"${CURRENT_BRANCH}"
54+
popd
5155

5256
else
5357
# THE REPO DID NOT EXIST
5458
echo "the repository did not previously exist cloning... "
55-
pushd "${INCLUDE_DIR}" || exit
56-
git clone --depth 1 "https://github.com/tree-sitter/${repo}" || exit
57-
popd || exit
59+
pushd "${INCLUDE_DIR}"
60+
git clone --depth 1 "https://github.com/tree-sitter/${repo}"
61+
popd
5862

5963
fi
6064
done
@@ -68,11 +72,11 @@ fi
6872
########################################################################
6973

7074
# build tree sitter library
71-
pushd "${INCLUDE_DIR}"/tree-sitter || exit
75+
pushd "${INCLUDE_DIR}"/tree-sitter
7276

7377
make
7478

75-
popd || exit
79+
popd
7680

7781
echo "building submitty_count_ts ..."
7882

@@ -81,16 +85,16 @@ mkdir -p "${INSTALLATION_DIR}/build"
8185

8286
cmake -S "${INSTALLATION_DIR}" -B "${INSTALLATION_DIR}/build" -DJSONDIR="${NLOHMANN_INCLUDE_DIR}"
8387

84-
pushd "${INSTALLATION_DIR}/build" || exit
88+
pushd "${INSTALLATION_DIR}/build"
8589

8690
make
8791

88-
popd || exit
92+
popd
8993

9094
# # change permissions
9195
if [ $# -eq 0 ]; then
9296
chown -R root:root "${INSTALLATION_DIR}"
9397
chmod -R 755 "${INSTALLATION_DIR}"
9498
fi
9599

96-
echo "Done setting up AnalysisToolsTS"
100+
echo "Done setting up AnalysisToolsTS"

0 commit comments

Comments
 (0)