File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -16,17 +16,17 @@ tokenize_command() {
16
16
check_allowed_commands () {
17
17
local cmd=" ${TOKENS[0]} "
18
18
for allowed in " ${ALLOWED_COMMANDS[@]} " ; do
19
- [[ " $cmd " == " $allowed " ]] && return 0
19
+ [[ " ${ cmd} " == " ${ allowed} " ]] && return 0
20
20
done
21
21
22
- echo >&2 " ERROR: refusing to run arbitrary command: $cmd "
22
+ echo >&2 " ERROR: refusing to run arbitrary command: ${ cmd} "
23
23
exit 1
24
24
}
25
25
26
26
validate_tokens () {
27
27
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} "
30
30
exit 1
31
31
fi
32
32
done
@@ -62,7 +62,8 @@ grep -lrF "${MARKER_START}" _wiki | while read -r file_to_process; do
62
62
USER_COMMAND=" ${line## " ${MARKER_START} " } "
63
63
USER_COMMAND=" ${USER_COMMAND%% " ${MARKER_END} " } "
64
64
65
- execute_command " $USER_COMMAND " < /dev/null || true
65
+ # shellcheck disable=SC2310
66
+ execute_command " ${USER_COMMAND} " < /dev/null || true
66
67
else
67
68
echo " ${line} "
68
69
fi
You can’t perform that action at this time.
0 commit comments