diff options
Diffstat (limited to 'playbooks.d/user-tyil/playbook.bash')
-rw-r--r-- | playbooks.d/user-tyil/playbook.bash | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/playbooks.d/user-tyil/playbook.bash b/playbooks.d/user-tyil/playbook.bash index de91595..00d5e8f 100644 --- a/playbooks.d/user-tyil/playbook.bash +++ b/playbooks.d/user-tyil/playbook.bash @@ -20,6 +20,7 @@ playbook_sync() { sudo zsh ) + local sharedir="$BASHTARD_ETCDIR/playbooks.d/$BASHTARD_PLAYBOOK/share" notice "$BASHTARD_PLAYBOOK" "Installing all desired utilities" for package in "${packages[@]}" @@ -27,6 +28,29 @@ playbook_sync() { pkg install "$package" done + grep -v '^#' "$sharedir/gittab" | while read -r tab dir + do + dir="$(config "users.tyil.home")/$dir" + + grep -v '^#' "$sharedir/gittab.d/$tab" | while read -r name repo branch + do + notice "$BASHTARD_PLAYBOOK" "Updating $dir/$name" + + if [[ ! -d "$dir/$name" ]] + then + git clone \ + --single-branch \ + --branch "$branch" \ + --depth 1 \ + "$repo" \ + "$dir/$name" + fi + + git -C "$dir/$name" checkout "$branch" + git -C "$dir/$name" pull "$repo" "$branch" + done + done + [[ $BASHTARD_COMMAND == "add" ]] && return notice "$BASHTARD_PLAYBOOK" "Updating dotfiles" |