`sibling` asks for a git URL, clones the repo into ~/.local/share/siblings/<name>, runs its install.sh and confirms the install. `sibling list` and `sibling remove` manage installed siblings. updates.d/71-siblings.sh pulls every sibling during `update` and runs its update.sh, reporting failures in the update summary. Document the sibling contract in skills/sibling-project-format.md and update the custom-hook guide to match. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
28 lines
653 B
Bash
Executable File
28 lines
653 B
Bash
Executable File
#!/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
|
|
}
|