aboutsummaryrefslogtreecommitdiff
path: root/lib/util.bash
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2023-03-10 10:49:16 +0100
committerPatrick Spek <p.spek@tyil.nl>2023-03-10 10:49:16 +0100
commit37749ec5c115adff9ed10d9a829f9af5f29776f4 (patch)
tree0a78f64bbc6f34261f32585bf9de721af20b96bb /lib/util.bash
parent28c55aa1a8c82def2ffdb3e000812a5523371ac5 (diff)
Update new code for shellcheck compliancy
Diffstat (limited to 'lib/util.bash')
-rw-r--r--lib/util.bash7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/util.bash b/lib/util.bash
index 489ccf1..54ec562 100644
--- a/lib/util.bash
+++ b/lib/util.bash
@@ -112,9 +112,10 @@ fetch_http_wget() {
# template, they are expected to be written as ${key}.
file_template()
{
- local file="$(playbook_path "base")/share/$1" ; shift
+ local file
local sedfile
+ file="$(playbook_path "base")/share/$1" ; shift
sedfile="$(tmpfile)"
if [[ ! -f $file ]]
@@ -192,8 +193,8 @@ playbook_path() {
fi
case "$1" in
- base) printf "$BASHTARD_ETCDIR/playbooks.d/$BASHTARD_PLAYBOOK" ;;
- data) printf "$BASHTARD_ETCDIR/data.d/$BASHTARD_PLAYBOOK" ;;
+ base) printf "%s/playbooks.d/%s" "$BASHTARD_ETCDIR" "$BASHTARD_PLAYBOOK" ;;
+ data) printf "%s/data.d/%s" "$BASHTARD_ETCDIR" "$BASHTARD_PLAYBOOK" ;;
*)
crit "bashtard/playbook_path" "Invalid path '$1'"
return 1