Skip to content

Commit

Permalink
add command to install shellcheck in macos (#1919)
Browse files Browse the repository at this point in the history
  • Loading branch information
juandspy authored Dec 21, 2023
1 parent 1484397 commit 53591b3
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions shellcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,15 @@
# limitations under the License.

if ! command -v shellcheck > /dev/null 2>&1; then
echo "Installing shellcheck"
scversion="stable" # or "v0.4.7", or "latest"
wget -qO- "https://github.com/koalaman/shellcheck/releases/download/${scversion?}/shellcheck-${scversion?}.linux.x86_64.tar.xz" | tar -xJv
shellcheck-stable/shellcheck --version
shellcheck-stable/shellcheck --exclude=SC1090,SC2086,SC2034,SC1091 -- *.sh */*.sh
else
shellcheck --exclude=SC1090,SC2086,SC2034,SC1091 -- *.sh */*.sh
unameOut="$(uname -s)"
case "${unameOut}" in
Linux*) wget -qO- "https://github.com/koalaman/shellcheck/releases/download/${scversion?}/shellcheck-${scversion?}.linux.x86_64.tar.xz" | tar -xJv ;;
Darwin*) brew install shellcheck ;;
*) machine="UNKNOWN:${unameOut}"
esac

fi
shellcheck --version
shellcheck --exclude=SC1090,SC2086,SC2034,SC1091 -- *.sh */*.sh

0 comments on commit 53591b3

Please sign in to comment.