Skip to content

Commit 62ae670

Browse files
authored
feat: add dependency check in install script (#13)
1 parent aeab939 commit 62ae670

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

palette-agent-install.sh.tmpl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
set -e
33
# set -x
44

5+
function check_dependency() {
6+
if ! command -v $1 &>/dev/null; then
7+
echo "$1 is not installed. Please install it and try again."
8+
exit 1
9+
fi
10+
}
11+
512
# Get the platform architecture
613
ARCH=$(uname -m)
714
VERSION=${PE_VERSION}
@@ -15,6 +22,12 @@ else
1522
echo "Unsupported architecture: $ARCH"
1623
fi
1724

25+
# Check if the required tools are installed
26+
dependencies=(bash systemctl jq rsync)
27+
for dep in "${dependencies[@]}"; do
28+
check_dependency $dep
29+
done
30+
1831
IMAGE=${IMAGE_REPO}/stylus-agent-mode-linux-${ARCH}:${VERSION}
1932
URL=${AGENT_URL_PREFIX}/palette-agent-linux-${ARCH}
2033

0 commit comments

Comments
 (0)