Skip to content

Commit 7ba4494

Browse files
committed
fix: configurable target arch
Signed-off-by: Tyler Gillson <[email protected]>
1 parent 27519f6 commit 7ba4494

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

install.sh

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
# sudo is required to copy binary to INSTALL_DIR for linux
88
: "${USE_SUDO:=false}"
99

10+
# Target architecture (optional, defaults to auto-detect)
11+
: "${ARCH:=}"
12+
1013
# Http request CLI
1114
HTTP_REQUEST_CLI=curl
1215

@@ -20,7 +23,9 @@ CLI_FILENAME=clusteradm
2023
CLI_FILE="${INSTALL_DIR}/${CLI_FILENAME}"
2124

2225
getSystemInfo() {
23-
ARCH=$(uname -m)
26+
if [ -z "$ARCH" ]; then
27+
ARCH=$(uname -m)
28+
fi
2429
case $ARCH in
2530
armv7*) ARCH="arm";;
2631
aarch64) ARCH="arm64";;
@@ -37,16 +42,16 @@ getSystemInfo() {
3742

3843
verifySupported() {
3944
local supported=(darwin-amd64 darwin-arm64 linux-amd64 linux-arm64 windows-amd64)
40-
local current_osarch="${OS}-${ARCH}"
45+
local target_osarch="${OS}-${ARCH}"
4146

4247
for osarch in "${supported[@]}"; do
43-
if [ "$osarch" == "$current_osarch" ]; then
44-
echo "Your system is ${OS}_${ARCH}"
48+
if [ "$osarch" == "$target_osarch" ]; then
49+
echo "Installing clusteradm for ${OS}_${ARCH}"
4550
return
4651
fi
4752
done
4853

49-
echo "No prebuilt binary for ${current_osarch}"
54+
echo "No prebuilt binary for ${target_osarch}"
5055
exit 1
5156
}
5257

0 commit comments

Comments
 (0)