This repository has been archived on 2026-06-13. You can view files and clone it, but cannot push or open issues or pull requests.
anvillm/mcptools/remove_dependency.sh

32 lines
845 B
Bash
Executable File

#!/bin/bash
# capabilities: beads
# description: Remove a dependency
# Usage: remove_dependency.sh --mount <mount> --child <child-id> --parent <parent-id>
set -euo pipefail
if cat /etc/shadow >/dev/null 2>&1; then
echo "Error: This script must be run via execute_code tool" >&2
exit 1
fi
MOUNT=""
CHILD=""
PARENT=""
while [[ $# -gt 0 ]]; do
case "$1" in
--mount) MOUNT="$2"; shift 2 ;;
--child) CHILD="$2"; shift 2 ;;
--parent) PARENT="$2"; shift 2 ;;
*) echo "unknown argument: $1" >&2; exit 1 ;;
esac
done
if [ -z "$MOUNT" ] || [ -z "$CHILD" ] || [ -z "$PARENT" ]; then
echo "usage: remove_dependency.sh --mount <mount> --child <child-id> --parent <parent-id>" >&2
exit 1
fi
echo "undep $CHILD $PARENT" | 9p write anvillm/beads/$MOUNT/ctl
echo "$CHILD no longer depends on $PARENT"