File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55SHELLCHECK_VERSION=" ${VERSION:- " os-provided" } "
66INSTALL_PATH=" ${INSTALLPATH:- " /usr/local/bin" } "
77
8- if [ " $( id -u) " -ne 0 ]; then
8+ if [[ " $( id -u) " -ne 0 ] ]; then
99 printf ' Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.'
1010 exit 1
1111fi
1212
1313
14- if [ " ${SHELLCHECK_VERSION} " = " os-provided" ]; then
14+ if [[ " ${SHELLCHECK_VERSION} " = " os-provided" ] ]; then
1515 apt update --yes
1616 apt install --no-install-recommends --yes shellcheck
1717
@@ -27,8 +27,8 @@ if ! type curl >/dev/null 2>&1; then
2727 curl_installed=" true"
2828fi
2929
30- if [ " ${SHELLCHECK_VERSION} " = " latest" ]; then
31- SHELLCHECK_VERSION=$( curl -s --head https://github.com/koalaman/shellcheck/releases/latest | sed -nr ' s/location:.*\/v(.+)/\1/ip' | tr -d ' \r' )
30+ if [[ " ${SHELLCHECK_VERSION} " = " latest" ] ]; then
31+ SHELLCHECK_VERSION=" $( curl -s --head https://github.com/koalaman/shellcheck/releases/latest | sed -nr ' s/location:.*\/v(.+)/\1/ip' | tr -d ' \r' ) "
3232fi
3333
3434machine=" $( uname -m) "
@@ -47,6 +47,6 @@ url="https://github.com/koalaman/shellcheck/releases/download/v${SHELLCHECK_VERS
4747
4848curl -sSL " ${url} " | tar --strip-components=1 -Jxvf - -C " ${INSTALL_PATH} " " shellcheck-v${SHELLCHECK_VERSION} /shellcheck"
4949
50- if [ -n " ${curl_installed} " ]; then
50+ if [[ -n " ${curl_installed} " ] ]; then
5151 apt purge curl --autoremove --yes
5252fi
You can’t perform that action at this time.
0 commit comments