Fix SC2030,SC2031.

This commit is contained in:
Darko Poljak 2018-10-06 08:36:06 +02:00
parent 68fad03a6b
commit f039b0e6e5

View file

@ -35,9 +35,13 @@ if [ ! -f "$__object/parameter/source" ] && [ ! -f "$__object/parameter/source-f
exit 1 exit 1
fi fi
if [ -f "$__object/parameter/source-file" ]; then
destination="${template_dir}/${name}"
require="__file${destination}"
fi
# Generate hcl config file # Generate hcl config file
# shellcheck disable=SC2031 {
(
printf 'template {\n' printf 'template {\n'
cd "$__object/parameter/" cd "$__object/parameter/"
for param in *; do for param in *; do
@ -47,14 +51,11 @@ for param in *; do
if [ "$source" = "-" ]; then if [ "$source" = "-" ]; then
source="$__object/stdin" source="$__object/stdin"
fi fi
destination="${template_dir}/${name}"
require="__directory${template_dir}" \ require="__directory${template_dir}" \
__file "$destination" \ __file "$destination" \
--owner root --group root --mode 640 \ --owner root --group root --mode 640 \
--source "$source" \ --source "$source" \
--state "$state" --state "$state"
# shellcheck disable=SC2030
export require="__file${destination}"
printf ' source = "%s"\n' "$destination" printf ' source = "%s"\n' "$destination"
;; ;;
@ -68,7 +69,7 @@ for param in *; do
esac esac
done done
printf '}\n' printf '}\n'
) | \ } | \
require="$require __directory${conf_dir}" \ require="$require __directory${conf_dir}" \
__config_file "${conf_dir}/${conf_file}" \ __config_file "${conf_dir}/${conf_file}" \
--owner root --group root --mode 640 \ --owner root --group root --mode 640 \