refactor(scripts): 拆分脚本为 init/ 和 detect/ 子目录,优化 init-llm.sh
This commit is contained in:
18
scripts/init/init-dev-branch.sh
Executable file
18
scripts/init/init-dev-branch.sh
Executable 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"
|
||||
Reference in New Issue
Block a user