HCY72TQRK2H7LRTEPPHDWTUVINPHZBGMTASY7FJRYS2WXCBRSMYQC lint || exit 1run
usage() {echo "$0: run all 'demo.sh' scripts using libdemo"echo " -l|--lint: run linter first"echo " -a|--auto: run in automatic mode"echo " -h|--help|-?: Show usage"}do_lint=0do_interactive=1while [[ $# -gt 0 ]]; docase $1 in-l|--lint)do_lint=1shift;;-a|--auto)do_interactive=0shift;;-h|--help|-\?)usageexit 0;;-*)echo "Unknown option $1"exit 1;;*)POSITIONAL_ARGS+=("$1") # save positional argshift;;esacdoneif [ "${do_lint}" = 1 ]; thenlint || exit 1elseLIBDEMO_INTERACTIVE="${do_interactive}" runfi
shellcheck_dir() {local path="${1}"shiftpushd "${path}" > /dev/null || return 1set +elocal retval=0while IFS= read -r f; doif shellcheck -S style -x "${f}"; then:elseretval=1fidone < <(grep --exclude-dir .git "${@}" -l -R -e '^#\!.*sh' -e '^# shellcheck shell' | sort)popd > /dev/null || return 1return "${retval}"}
# https://github.com/koalaman/shellcheck/blob/master/shellcheck.1.md# Look for 'source'd files relative to the checked scriptsource-path=SCRIPTDIR# Suggest adding a default case in `case` statementsenable=add-default-case# Suggest explicitly using -n in `[ $var ]`enable=avoid-nullary-conditions# Turn on warnings for unassigned uppercase variables# enable=check-unassigned-uppercase# Turn on warnings for unquoted variables with safe valuesenable=quote-safe-variables# Suggest putting braces around all variable referencesenable=require-variable-braces