Skip to content

Commit

Permalink
ensure-shellcheck.sh checks for macos
Browse files Browse the repository at this point in the history
  • Loading branch information
NotAName320 committed Dec 1, 2023
1 parent 11a0af3 commit bc162f7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion images/capi/hack/ensure-shellcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,17 @@ set -o pipefail
[[ -n ${DEBUG:-} ]] && set -o xtrace

scversion="stable"
operatingsystem="darwin.x86_64"

if [[ "$OSTYPE" == "darwin"* ]]; then
operatingsystem="darwin.x86_64"
else
operatingsystem="linux.x86_64"
fi

if command -v shellcheck >/dev/null 2>&1; then exit 0; fi

wget -qO- "https://github.com/koalaman/shellcheck/releases/download/${scversion?}/shellcheck-${scversion?}.linux.x86_64.tar.xz" | tar -xJv
wget -qO- "https://github.com/koalaman/shellcheck/releases/download/${scversion?}/shellcheck-${scversion?}.${operatingsystem?}.tar.xz" | tar -xJv
cp "shellcheck-${scversion}/shellcheck" ~/.local/bin/
rm -rf "./shellcheck-${scversion}"
shellcheck --version

0 comments on commit bc162f7

Please sign in to comment.