Skip to content

Commit a31fe6f

Browse files
authored
Merge pull request #9 from Zan-getsu/nb
Enhance install.sh to support multiple architectures
2 parents 89bab5f + e294838 commit a31fe6f

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

install.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,19 @@ export PATH=$PATH:/usr/local/go/bin
2323
if ! command -v go &>/dev/null; then
2424
echo "Go not found. Installing Go 1.23.2..."
2525

26+
# Detect Architecture
27+
ARCH=$(uname -m)
28+
case $ARCH in
29+
x86_64) GO_ARCH="amd64" ;;
30+
aarch64) GO_ARCH="arm64" ;;
31+
arm64) GO_ARCH="arm64" ;;
32+
*) echo "Unsupported architecture: $ARCH"; exit 1 ;;
33+
esac
34+
35+
echo "Detected architecture: linux-$GO_ARCH"
36+
2637
# Download Go
27-
curl -L "https://go.dev/dl/go1.23.2.linux-amd64.tar.gz" -o /tmp/go.tar.gz
38+
curl -L "https://go.dev/dl/go1.23.2.linux-$GO_ARCH.tar.gz" -o /tmp/go.tar.gz
2839

2940
# Remove old installation if exists
3041
rm -rf /usr/local/go

0 commit comments

Comments
 (0)