Explorar o código

Meta: lint-shell-scripts: Exit if shellcheck is not installed

Brendan Coles %!s(int64=4) %!d(string=hai) anos
pai
achega
c1bfb8cb0e
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  1. 5 0
      Meta/lint-shell-scripts.sh

+ 5 - 0
Meta/lint-shell-scripts.sh

@@ -4,6 +4,11 @@ set -e pipefail
 script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
 cd "$script_path/.."
 
+if ! command -v shellcheck &>/dev/null ; then
+    echo "shellcheck is not available. Either skip this script, or install shellcheck."
+    exit 1
+fi
+
 ERRORS=()
 
 while IFS= read -r f; do