-
-
Notifications
You must be signed in to change notification settings - Fork 72
Expand file tree
/
Copy pathtest_scripts_help.sh
More file actions
executable file
·56 lines (49 loc) · 1.38 KB
/
test_scripts_help.sh
File metadata and controls
executable file
·56 lines (49 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env bash
#
# Ensure each script can display help message to ensure basic execution.
#
# This script must be run from within the pipenv shell or a properly configured
# environment. For example:
#
# 1. Using pipenv run
# pipenv run ./dev/test_scripts_help.sh
#
# 2. Using pipenv shell
# pipenv shell
# ./dev/test_scripts_help.sh
#
# 3. A properly configured environment
# (see .github/workflows/test_scripts_help.yml)
#
#### SETUP ####################################################################
set -o errexit
set -o errtrace
set -o nounset
# shellcheck disable=SC2154
trap '_es=${?};
printf "${0}: line ${LINENO}: \"${BASH_COMMAND}\"";
printf " exited with a status of ${_es}\n";
exit ${_es}' ERR
DIR_REPO="$(cd -P -- "${0%/*}/.." && pwd -P)"
EXIT_STATUS=0
#### FUNCTIONS ################################################################
test_help() {
local _es _script
for _script in $(find scripts/?-* -type f -name '*.py' | sort)
do
_es=0
./"${_script}" --help &>/dev/null || _es=${?}
if (( _es == 0 ))
then
echo "✅ ${_script}"
else
echo "❌ ${_script}"
EXIT_STATUS=${_es}
fi
done
}
#### MAIN #####################################################################
cd "${DIR_REPO}"
test_help
echo "exit status: ${EXIT_STATUS}"
exit ${EXIT_STATUS}