JGZ7GBCLGDQVN7FOJMXAR5BEB4MV6F4F2CIMUCIUV7E52AFIUFRAC
for f in $(find . -name 'demo.sh' | sort); do
clear
demoheader "$(dirname "${f}")"
"${f}"
done
lint() {
for f in $(find "$(dirname "${BASH_SOURCE[0]}")" -name 'demo.sh' | sort); do
demoheader "$(dirname "${f}" | sed 's|^\./||')"
shellcheck_dir "$(dirname "${f}")" || return 1
done
}
run() {
for f in $(find "$(dirname "${BASH_SOURCE[0]}")" -name 'demo.sh' | sort); do
democlear
demoheader "$(dirname "${f}" | sed 's|^\./||')"
"${f}"
done
}
lint || exit 1
run
shellcheck_dir() {
local path="${1}"
shift
pushd "${path}" > /dev/null || return 1
set +e
local retval=0
while IFS= read -r f; do
if shellcheck -S style -x "${f}"; then
:
else
retval=1
fi
done < <(grep --exclude-dir .git "${@}" -l -R -e '^#\!.*sh' -e '^# shellcheck shell' | sort)
popd > /dev/null || return 1
return "${retval}"
}