6
0
Fork 0
This repository has been archived on 2022-03-14. You can view files and clone it, but cannot push or open issues or pull requests.
cdist-recycledcloud/scripts/run-shellcheck.sh
2020-10-13 09:28:40 +02:00

21 lines
639 B
Bash
Executable file

#!/bin/sh
SHELLCHECKCMD="shellcheck -s sh -f gcc -x"
# Skip SC2154 for variables starting with __ since such variables are cdist
# environment variables.
SHELLCHECK_SKIP=': __.*is referenced but not assigned.*\[SC2154\]'
SHELLCHECKTMP=".shellcheck.tmp"
# Move to top-level cdist-contrib directory.
cd $(dirname $0)/..
check () {
find type/ -type f $1 $2 -exec ${SHELLCHECKCMD} {} + | grep -v "${SHELLCHECK_SKIP}" > "${SHELLCHECKTMP}"
test ! -s "${SHELLCHECKTMP}" || { cat "${SHELLCHECKTMP}"; exit 1; }
}
check -path "*/explorer/*"
check -path "*/files/*.sh"
check -name manifest
check -name gencode-local
check -name gencode-remote