Files
vibe-foreman/scripts/hub-notify.sh
T
wuguanganandClaude Opus 4.6 5519188cd5 initial commit: claude-hub dispatch center
tmux 多项目窗口管理 + 全局通知 hooks(Stop/Notification)
- scripts/setup.sh 一键初始化
- scan-projects.sh 自动发现项目
- hub-hook-stop.sh / hub-hook-permission.sh 全局通知
- skills: tmux-hub, browser-auto, lanhu-design-viewer

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 09:38:42 +08:00

28 lines
742 B
Bash
Executable File

#!/bin/bash
# hub-notify: 手动通知 hub 任务完成
# 用法: hub-notify [channel] [exit_code]
#
# 不传 channel 则列出等待中的信号
# 不传 exit_code 默认 0
CHANNEL="${1:-$HUB_CHANNEL}"
EXIT_CODE="${2:-0}"
SIGNAL_DIR="/tmp/hub-signals"
if [ -z "$CHANNEL" ]; then
echo "等待中的 channel:"
if [ -d "$SIGNAL_DIR" ]; then
ls "$SIGNAL_DIR"/*.result 2>/dev/null | sed 's|.*/||;s|\.result||' | while read f; do
echo " $f (exit: $(cat "$SIGNAL_DIR/$f.result"))"
done
fi
echo ""
echo "用法: hub-notify <channel> [exit_code]"
exit 1
fi
mkdir -p "$SIGNAL_DIR"
echo "$EXIT_CODE" > "$SIGNAL_DIR/$CHANNEL.result"
tmux wait-for -S "$CHANNEL" 2>/dev/null
echo "已通知 hub: $CHANNEL (exit: $EXIT_CODE)"