Skip to content

Commit c8f1f78

Browse files
committed
automated arch selection on linux installer
1 parent 180f1e9 commit c8f1f78

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

packaging/linux/script/install.sh

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,27 @@ determineDistro()
2424

2525
determineDistro
2626

27+
case "$(uname -m)" in
28+
"x86_64" | "amd64")
29+
$ARCH="amd64"
30+
;;
31+
"aarch64" | "arm64")
32+
$ARCH="arm64"
33+
;;
34+
"i386" | "i686")
35+
$ARCH="x86"
36+
;;
37+
*)
38+
echo "Unsupported architecture."
39+
exit 1
40+
;;
41+
esac
42+
2743
if [ -z "$SOURCE" ]; then
2844
if [ "$DISTRO" = "alpine" ]; then
29-
SOURCE="https://github.com/draconware-dev/LineCount/releases/download/__VERSION__/loc-__VERSION__-linux-alpine-amd64.tar.xz"
45+
SOURCE="https://github.com/draconware-dev/LineCount/releases/download/__VERSION__/loc-__VERSION__-linux-alpine-$ARCH.tar.xz"
3046
else
31-
SOURCE="https://github.com/draconware-dev/LineCount/releases/download/__VERSION__/loc-__VERSION__-linux-amd64.tar.xz"
47+
SOURCE="https://github.com/draconware-dev/LineCount/releases/download/__VERSION__/loc-__VERSION__-linux-$ARCH.tar.xz"
3248
fi
3349
fi
3450

0 commit comments

Comments
 (0)