From fba67928920f3b1e6d10123de9a7efae0dac177f Mon Sep 17 00:00:00 2001
From: Patrick Spek
Date: Sun, 17 Apr 2022 22:56:59 +0200
Subject: Make shellcheck happy
---
lib/subcommands/sync.bash | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
(limited to 'lib/subcommands/sync.bash')
diff --git a/lib/subcommands/sync.bash b/lib/subcommands/sync.bash
index 7722e2d..0ec2ffc 100644
--- a/lib/subcommands/sync.bash
+++ b/lib/subcommands/sync.bash
@@ -9,7 +9,7 @@ subcommand()
export BASHTARD_PLAYBOOK="$1" ; shift
# If a specific playbook is given, sync that
- if [[ ! -z "$BASHTARD_PLAYBOOK" ]]
+ if [[ -n "$BASHTARD_PLAYBOOK" ]]
then
sync_playbook "$BASHTARD_PLAYBOOK"
return
@@ -19,9 +19,10 @@ subcommand()
notice "bashtard/sync" "Syncing remote playbooks"
# Update all playbook sources
- while read -r playbook url branch
+ while read -r playbook _ branch
do
- pushd -- "$BASHTARD_ETCDIR/playbooks.d/$playbook"
+ pushd -- "$BASHTARD_ETCDIR/playbooks.d/$playbook" \
+ || return 2
git pull origin "$branch"
done < "$BASHTARD_ETCDIR/playbooks.d/remotes"
@@ -51,6 +52,7 @@ sync_playbook()
return 1
fi
+ # shellcheck disable=SC1090
. "$playbook_base/playbook.bash"
playbook_sync
--
cgit v1.1