change to update format
This commit is contained in:
Executable
+27
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user