Skip to content

Commit a339053

Browse files
committed
Add support for arm64 version of shellcheck. Closes #74
1 parent 6e0e63d commit a339053

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

script.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,22 @@ cd "${TEMP_PATH}" || exit
88
mkdir bin
99

1010
WINDOWS_TARGET=zip
11-
LINUX_TARGET=linux.x86_64.tar.xz
12-
MACOS_TARGET=darwin.x86_64.tar.xz
1311

12+
# Get system architecture
13+
ARCH=$(uname -m)
14+
if [[ "${ARCH}" == "arm64" || "${ARCH}" == "aarch64" ]]; then
15+
CPU_ARCH="aarch64"
16+
else
17+
CPU_ARCH="x86_64"
18+
fi
19+
20+
# Set targets based on OS and architecture
1421
if [[ $(uname -s) == "Linux" ]]; then
22+
LINUX_TARGET="linux.${CPU_ARCH}.tar.xz"
1523
curl -sL "https://github.com/koalaman/shellcheck/releases/download/v${SHELLCHECK_VERSION}/shellcheck-v${SHELLCHECK_VERSION}.${LINUX_TARGET}" | tar -xJf -
1624
cp "shellcheck-v$SHELLCHECK_VERSION/shellcheck" ./bin
1725
elif [[ $(uname -s) == "Darwin" ]]; then
26+
MACOS_TARGET="darwin.${CPU_ARCH}.tar.xz"
1827
curl -sL "https://github.com/koalaman/shellcheck/releases/download/v${SHELLCHECK_VERSION}/shellcheck-v${SHELLCHECK_VERSION}.${MACOS_TARGET}" | tar -xJf -
1928
cp "shellcheck-v$SHELLCHECK_VERSION/shellcheck" ./bin
2029
else

0 commit comments

Comments
 (0)