Skip to content

Commit

Permalink
Mac Support for ShellCheck
Browse files Browse the repository at this point in the history
  • Loading branch information
gitricko authored Jun 8, 2024
1 parent 7bb09a2 commit ee1c6b8
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions makefile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -168,19 +168,21 @@ function sonar-ext-get() {

if [ ! -f "${SONAR_EXTENSION_DIR}/shellcheck" ]; then
# src: https://github.com/koalaman/shellcheck/blob/master/Dockerfile.multi-arch
arch="$(uname -m)";
tag=latest
arch="$(uname -m)"
tmp="$(uname)"
os="${tmp,,}"
tag="v0.10.0"

if [ "${arch}" = 'armv7l' ]; then
arch='armv6hf';
arch='armv6hf'
fi

url_base='https://github.com/koalaman/shellcheck/releases/download/'
tar_file="${tag}/shellcheck-${tag}.linux.${arch}.tar.xz";
tar_file="${tag}/shellcheck-${tag}.${os}.${arch}.tar.xz"
curl -s --fail --location --progress-bar "${url_base}${tar_file}" | tar xJf -

mv "shellcheck-${tag}/shellcheck" "${SONAR_EXTENSION_DIR}/";
rm -rf "shellcheck-${tag}";
mv "shellcheck-${tag}/shellcheck" "${SONAR_EXTENSION_DIR}/"
rm -rf "shellcheck-${tag}"
fi

SONAR_SHELLCHECK="sonar-shellcheck-plugin-2.5.0.jar"
Expand Down

0 comments on commit ee1c6b8

Please sign in to comment.