Disable SC2059 (printf injection) for staged_file

We're explicitly allowing for 'printf injection' here, so it's ok to
just disable the corresponding shellcheck check.
This commit is contained in:
Jonas Weber 2018-10-04 21:30:28 +02:00
parent e2593c0dcb
commit a0db375f91

View file

@ -57,6 +57,7 @@ get_file() {
}
fetch_file() {
# shellcheck disable=SC2059
printf "$fetch_command" "$source"
printf ' > "%s"\n' "$stage_file"
}
@ -64,8 +65,10 @@ fetch_file() {
fetch_and_prepare_file() {
printf 'tmpdir="$(mktemp -d --tmpdir="/tmp" "%s")"\n' "${__type##*/}.XXXXXXXXXX"
printf 'cd "$tmpdir"\n'
# shellcheck disable=SC2059
printf "$fetch_command > \"%s\"\n" "$source" "$source_file_name"
prepare_command="$(cat "$__object/parameter/prepare-command")"
# shellcheck disable=SC2059
printf "$prepare_command > \"%s\"\n" "$source_file_name" "$stage_file"
printf 'cd - >/dev/null\n'
printf 'rm -rf "$tmpdir"\n'