Files
dsh-markmag/scripts/bootstrap.sh
T

30 lines
1.3 KiB
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
# 员工一键接入(2026-11-11):装插件(Gitea)+ 取码换 key。
#
# 跑法(员工唯一要记的一条;bash <(...) 保住终端输入,取码时还要粘码):
# bash <(curl -fsSL https://brain.sidaocai.cn/git/sidaocai/dsh-markmag/raw/branch/main/scripts/bootstrap.sh)
#
# 可选环境变量:DSH_CLI(CLI 路径)、PROFILE(默认 desktop)、DSH_REPO(自建源)
set -euo pipefail
DSH_CLI="${DSH_CLI:-/Applications/DeepSeek Harness.app/Contents/Resources/runtime/cli/bin/dsh}"
PROFILE="${1:-${PROFILE:-desktop}}"
DSH_REPO="${DSH_REPO:-https://brain.sidaocai.cn/git/sidaocai/dsh-markmag.git}"
if [ ! -x "$DSH_CLI" ]; then
echo "✗ 没找到 DSH 命令行($DSH_CLI)。先装 DeepSeek Harness 桌面端,或用 DSH_CLI= 指路径。"
exit 1
fi
echo "[1/2] 安装弹匣插件 → profile: $PROFILE"
"$DSH_CLI" plugin --profile "$PROFILE" add "$DSH_REPO"
echo "[2/2] 取码换 key(浏览器会自动打开)"
PKG="$HOME/.dsh/profiles/$PROFILE/node_modules/@sidaocai/dsh-markmag/scripts/setup-key.mjs"
if [ ! -f "$PKG" ]; then
# 包内没带脚本(旧版本插件)时,直接从 Gitea raw 拉最新
curl -fsSL "$DSH_REPO/raw/branch/main/scripts/setup-key.mjs" -o /tmp/dsh-setup-key.mjs
PKG=/tmp/dsh-setup-key.mjs
fi
exec node "$PKG"