Skip to content

Commit 6d5fd6d

Browse files
committed
Disable checking for ||
This was like that when I found it, and I believe it was done on purpose.
1 parent ff5ed3b commit 6d5fd6d

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

build/wiki-command-replacer.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ tokenize_command() {
1616
check_allowed_commands() {
1717
local cmd="${TOKENS[0]}"
1818
for allowed in "${ALLOWED_COMMANDS[@]}"; do
19-
[[ "$cmd" == "$allowed" ]] && return 0
19+
[[ "${cmd}" == "${allowed}" ]] && return 0
2020
done
2121

22-
echo >&2 " ERROR: refusing to run arbitrary command: $cmd"
22+
echo >&2 " ERROR: refusing to run arbitrary command: ${cmd}"
2323
exit 1
2424
}
2525

2626
validate_tokens() {
2727
for token in "${TOKENS[@]}"; do
28-
if [[ "$token" =~ [\;\|\&\$\<\>\`\\] ]]; then
29-
echo >&2 " ERROR: refusing unsafe token: $token"
28+
if [[ "${token}" =~ [\;\|\&\$\<\>\`\\] ]]; then
29+
echo >&2 " ERROR: refusing unsafe token: ${token}"
3030
exit 1
3131
fi
3232
done
@@ -62,7 +62,8 @@ grep -lrF "${MARKER_START}" _wiki | while read -r file_to_process; do
6262
USER_COMMAND="${line##"${MARKER_START}"}"
6363
USER_COMMAND="${USER_COMMAND%%"${MARKER_END}"}"
6464

65-
execute_command "$USER_COMMAND" </dev/null || true
65+
# shellcheck disable=SC2310
66+
execute_command "${USER_COMMAND}" </dev/null || true
6667
else
6768
echo "${line}"
6869
fi

0 commit comments

Comments
 (0)