From 873f09d3bfea04623dd3ebae4063eb3a78a997d7 Mon Sep 17 00:00:00 2001 From: lanyuanxiaoyao Date: Wed, 22 Apr 2026 14:57:14 +0800 Subject: [PATCH] =?UTF-8?q?refactor(scripts):=20=E6=8B=86=E5=88=86?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=E4=B8=BA=20init/=20=E5=92=8C=20detect/=20?= =?UTF-8?q?=E5=AD=90=E7=9B=AE=E5=BD=95=EF=BC=8C=E4=BC=98=E5=8C=96=20init-l?= =?UTF-8?q?lm.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/{ => detect}/README.md | 0 scripts/{ => detect}/core.py | 0 scripts/{ => detect}/detect_anthropic.py | 0 scripts/{ => detect}/detect_openai.py | 0 scripts/init/init-dev-branch.sh | 18 ++++++++++++++++++ scripts/init/init-llm.sh | 13 +++++++++++++ 6 files changed, 31 insertions(+) rename scripts/{ => detect}/README.md (100%) rename scripts/{ => detect}/core.py (100%) rename scripts/{ => detect}/detect_anthropic.py (100%) rename scripts/{ => detect}/detect_openai.py (100%) create mode 100755 scripts/init/init-dev-branch.sh create mode 100755 scripts/init/init-llm.sh diff --git a/scripts/README.md b/scripts/detect/README.md similarity index 100% rename from scripts/README.md rename to scripts/detect/README.md diff --git a/scripts/core.py b/scripts/detect/core.py similarity index 100% rename from scripts/core.py rename to scripts/detect/core.py diff --git a/scripts/detect_anthropic.py b/scripts/detect/detect_anthropic.py similarity index 100% rename from scripts/detect_anthropic.py rename to scripts/detect/detect_anthropic.py diff --git a/scripts/detect_openai.py b/scripts/detect/detect_openai.py similarity index 100% rename from scripts/detect_openai.py rename to scripts/detect/detect_openai.py diff --git a/scripts/init/init-dev-branch.sh b/scripts/init/init-dev-branch.sh new file mode 100755 index 0000000..f560016 --- /dev/null +++ b/scripts/init/init-dev-branch.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +set -euo pipefail + +if [ $# -eq 0 ]; then + echo "Usage: $0 " + 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" diff --git a/scripts/init/init-llm.sh b/scripts/init/init-llm.sh new file mode 100755 index 0000000..10dd1a3 --- /dev/null +++ b/scripts/init/init-llm.sh @@ -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" \ No newline at end of file