diff options
Diffstat (limited to 'sbpull.bash')
| -rw-r--r-- | sbpull.bash | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sbpull.bash b/sbpull.bash index cd48864..a390e38 100644 --- a/sbpull.bash +++ b/sbpull.bash @@ -1,4 +1,5 @@ # sbpull: pull one overlay subtree into SBo-danix, then reconcile shadowing. +# Usage: sbpull {personal|pentesting} [--yes|--no], the flag goes to sbshadow. # Source from root's ~/.bashrc: . /path/to/sbpull.bash # # Copyright (C) 2026 Danilo M. <danix@danix.xyz> @@ -9,7 +10,7 @@ sbpull() { local repo_dir="/var/lib/sbopkg/SBo-danix" - local target="$1" + local target="$1" flag="${2:-}" local prefix branch remote case "$target" in @@ -22,7 +23,7 @@ sbpull() { remote="my-pentesting" ;; *) - echo "sbpull: usage: sbpull {personal|pentesting}" >&2 + echo "sbpull: usage: sbpull {personal|pentesting} [--yes|--no]" >&2 return 1 ;; esac @@ -33,12 +34,13 @@ sbpull() { if git subtree pull --prefix="$prefix" "$remote" "$branch" --squash; then echo "sbpull: $target subtree updated." - sbshadow + sbshadow ${flag:+"$flag"} + local rc=$? + popd > /dev/null + return "$rc" else echo "sbpull: git subtree pull failed for $target, check output above." >&2 popd > /dev/null return 1 fi - - popd > /dev/null } |
