Skip to content

Commit f06c632

Browse files
committed
chore: updated sample permissions checker to have better error output
Signed-off-by: Carl Flottmann <[email protected]>
1 parent d285d37 commit f06c632

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

scripts/dev_scripts/samples_permissions_checker.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,23 @@
88
# failing if any do.
99
#
1010

11+
# Strict bash options.
12+
#
13+
# -e: exit immediately if a command fails (with non-zero return code),
14+
# or if a function returns non-zero.
15+
#
16+
# -u: treat unset variables and parameters as error when performing
17+
# parameter expansion.
18+
# In case a variable ${VAR} is unset but we still need to expand,
19+
# use the syntax ${VAR:-} to expand it to an empty string.
20+
#
21+
# -o pipefail: set the return value of a pipeline to the value of the last
22+
# (rightmost) command to exit with a non-zero status, or zero
23+
# if all commands in the pipeline exit successfully.
24+
#
25+
# Reference: https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html.
26+
set -euo pipefail
27+
1128
MACARON_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && cd ../.. && pwd)"
1229
SAMPLES_PATH="${MACARON_DIR}/tests/malware_analyzer/pypi/resources/sourcecode_samples"
1330

0 commit comments

Comments
 (0)