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/mark_pending_approval.sh

36 lines
995 B
Bash
Executable File

#!/bin/bash
# capabilities: beads
# description: Mark a bead as pending approval
# Usage: mark_pending_approval.sh --mount <mount> --id <bead-id> [--assignee <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=""
BEAD_ID=""
ASSIGNEE=""
while [[ $# -gt 0 ]]; do
case "$1" in
--mount) MOUNT="$2"; shift 2 ;;
--id) BEAD_ID="$2"; shift 2 ;;
--assignee) ASSIGNEE="$2"; shift 2 ;;
*) echo "unknown argument: $1" >&2; exit 1 ;;
esac
done
if [ -z "$MOUNT" ] || [ -z "$BEAD_ID" ]; then
echo "usage: mark_pending_approval.sh --mount <mount> --id <bead-id> [--assignee <id>]" >&2
exit 1
fi
if [ -n "$ASSIGNEE" ]; then
echo "pending-approval $BEAD_ID $ASSIGNEE" | 9p write anvillm/beads/$MOUNT/ctl
else
echo "pending-approval $BEAD_ID" | 9p write anvillm/beads/$MOUNT/ctl
fi
echo "pending-approval: $BEAD_ID${ASSIGNEE:+ → $ASSIGNEE}"