2018-12-18 02:08:53 +01:00
|
|
|
#!/usr/bin/env bash
|
2018-08-03 02:09:42 +02:00
|
|
|
set -eu
|
|
|
|
|
2018-12-12 17:24:01 +01:00
|
|
|
version=0.6.0
|
2018-08-03 02:09:42 +02:00
|
|
|
|
|
|
|
if ! out="$(shellcheck --version 2>/dev/null)" || [[ "$out" != *"
|
|
|
|
version: $version
|
|
|
|
"* ]]; then
|
|
|
|
tmpdir="$(mktemp -d)"
|
|
|
|
trap 'rm -r "$tmpdir"' EXIT
|
|
|
|
cd "$tmpdir"
|
|
|
|
wget -nv "https://storage.googleapis.com/shellcheck/shellcheck-v$version.linux.x86_64.tar.xz"
|
|
|
|
tar -xJf "shellcheck-v$version.linux.x86_64.tar.xz" --no-same-owner --strip-components=1 -C /usr/local/bin "shellcheck-v$version/shellcheck"
|
|
|
|
fi
|