From 37749ec5c115adff9ed10d9a829f9af5f29776f4 Mon Sep 17 00:00:00 2001
From: Patrick Spek
Date: Fri, 10 Mar 2023 10:49:16 +0100
Subject: Update new code for shellcheck compliancy
---
lib/util.bash | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
(limited to 'lib/util.bash')
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
--
cgit v1.1