aboutsummaryrefslogtreecommitdiff
path: root/lib/subcommands/sync.bash
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2022-04-17 22:56:59 +0200
committerPatrick Spek <p.spek@tyil.nl>2022-04-17 22:56:59 +0200
commitfba67928920f3b1e6d10123de9a7efae0dac177f (patch)
tree1b94866fde92c24c660f181fd1631f380595b349 /lib/subcommands/sync.bash
parentfa150b95d3d9d9b3ea51a03e9243d2b4b2a6c761 (diff)
Make shellcheck happy
Diffstat (limited to 'lib/subcommands/sync.bash')
-rw-r--r--lib/subcommands/sync.bash8
1 files changed, 5 insertions, 3 deletions
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