1
0

refactor(scripts): 拆分脚本为 init/ 和 detect/ 子目录,优化 init-llm.sh

This commit is contained in:
2026-04-22 14:57:14 +08:00
parent 5e7267db07
commit 873f09d3bf
6 changed files with 31 additions and 0 deletions

18
scripts/init/init-dev-branch.sh Executable file
View File

@@ -0,0 +1,18 @@
#!/bin/bash
set -euo pipefail
if [ $# -eq 0 ]; then
echo "Usage: $0 <branch-name>"
exit 1
fi
BRANCH_NAME="$1"
ROOT_DIR=$(git rev-parse --show-toplevel)
WORKTREES_DIR="$ROOT_DIR/.worktrees"
mkdir -p "$WORKTREES_DIR"
git worktree add -b "$BRANCH_NAME" "$WORKTREES_DIR/$BRANCH_NAME"
echo "Worktree created at $WORKTREES_DIR/$BRANCH_NAME"

13
scripts/init/init-llm.sh Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/bash
set -euo pipefail
TOOLS="${1:-claude,opencode}"
ROOT_DIR=$(git rev-parse --show-toplevel)
cd "$ROOT_DIR"
openspec init --tools "$TOOLS"
echo "OpenSpec initialized with tools: $TOOLS"