mission-control/scripts/task.sh

40 lines
1.4 KiB
Bash
Executable File

#!/bin/bash
# Mission Control Task CLI Wrapper
# Delegates to gantt-board task.sh for task operations
# This maintains the architecture principle: CLI is passthrough to API
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Auto-detect gantt-board directory if not set
if [[ -z "${GANTT_BOARD_DIR:-}" ]]; then
# Try common locations
if [[ -d "$SCRIPT_DIR/../../../gantt-board" ]]; then
GANTT_BOARD_DIR="$SCRIPT_DIR/../../../gantt-board"
elif [[ -d "$HOME/Documents/Projects/OpenClaw/Web/gantt-board" ]]; then
GANTT_BOARD_DIR="$HOME/Documents/Projects/OpenClaw/Web/gantt-board"
elif [[ -d "/Users/mattbruce/Documents/Projects/OpenClaw/Web/gantt-board" ]]; then
GANTT_BOARD_DIR="/Users/mattbruce/Documents/Projects/OpenClaw/Web/gantt-board"
fi
fi
# Verify gantt-board is available
if [[ -z "${GANTT_BOARD_DIR:-}" ]]; then
echo "Error: GANTT_BOARD_DIR not set and gantt-board not found" >&2
echo "" >&2
echo "Please set GANTT_BOARD_DIR to the path of your gantt-board installation:" >&2
echo " export GANTT_BOARD_DIR=/path/to/gantt-board" >&2
exit 1
fi
if [[ ! -f "$GANTT_BOARD_DIR/scripts/task.sh" ]]; then
echo "Error: gantt-board task.sh not found at $GANTT_BOARD_DIR/scripts/task.sh" >&2
echo "" >&2
echo "Please ensure gantt-board is installed correctly." >&2
exit 1
fi
# Delegate all calls to gantt-board task.sh
exec "$GANTT_BOARD_DIR/scripts/task.sh" "$@"