From b83243d3f290b8b9edb0ed8cf41edc9f317a6aa2 Mon Sep 17 00:00:00 2001 From: Saverio Miroddi Date: Sat, 24 Apr 2021 09:56:14 +0200 Subject: [PATCH] CI: Always download the latest Shellcheck version The previous logic was also semantically incorrect, as the file was never cached, therefore, the `if` was redundant. --- ci/run_shellcheck.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/ci/run_shellcheck.sh b/ci/run_shellcheck.sh index cab0bca..a54d11b 100755 --- a/ci/run_shellcheck.sh +++ b/ci/run_shellcheck.sh @@ -6,15 +6,19 @@ set -o nounset set -o errtrace shopt -s inherit_errexit -if [[ ! -e /opt/shellcheck/shellcheck ]]; then - mkdir -p /opt/shellcheck +# Always download the latest version: +# +# - it's fast and stable enough not to worry about it; +# - the workflow is basically single-person, so there's no risk of a new dev encountering an error found +# by a new shellcheck version. - wget -qO- https://github.com/koalaman/shellcheck/releases/download/stable/shellcheck-stable.linux.x86_64.tar.xz \ - | tar xJv -O shellcheck-stable/shellcheck \ - > /opt/shellcheck/shellcheck +mkdir -p /opt/shellcheck - chmod +x /opt/shellcheck/shellcheck -fi +wget -qO- https://github.com/koalaman/shellcheck/releases/download/stable/shellcheck-stable.linux.x86_64.tar.xz \ + | tar xJv -O shellcheck-stable/shellcheck \ + > /opt/shellcheck/shellcheck + +chmod +x /opt/shellcheck/shellcheck /opt/shellcheck/shellcheck --version