aboutsummaryrefslogtreecommitdiff
path: root/lib/subcommands/sync.bash
diff options
context:
space:
mode:
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