change to update format

This commit is contained in:
David Young
2026-10-23 08:04:42 -06:00
parent 0b2ac8ca29
commit 872ad4b831
14 changed files with 663 additions and 111 deletions
+27
View File
@@ -0,0 +1,27 @@
#!/bin/bash
# Sibling projects installed with the `sibling` command
SIBLINGS="$HOME/.local/share/siblings"
is_installed() {
compgen -G "$SIBLINGS/*/.git" > /dev/null
}
run_update() {
echo "Updating sibling projects..."
local dir name failed=0
for dir in "$SIBLINGS"/*/; do
[ -d "$dir/.git" ] || continue
name="$(basename "$dir")"
echo " $name"
if ! git -C "$dir" pull --ff-only --quiet; then
echo " Could not pull $name."
failed=1
continue
fi
if [ -f "$dir/update.sh" ]; then
(cd "$dir" && bash update.sh) || { echo " $name's update.sh failed."; failed=1; }
fi
done
return $failed
}