优化quickstart.sh,添加远程仓库推送相关配置
This commit is contained in:
@@ -219,7 +219,7 @@ main() {
|
|||||||
print_info "配置 AI API..."
|
print_info "配置 AI API..."
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
PKUAI_API_KEY=$(read_input "PKU AI API Key" "" "true")
|
PKUAI_API_KEY=$(read_password "PKU AI API Key" "true")
|
||||||
PKUAI_API_BASE=$(read_input "PKU AI API Base URL" "https://chat.noc.pku.edu.cn/")
|
PKUAI_API_BASE=$(read_input "PKU AI API Base URL" "https://chat.noc.pku.edu.cn/")
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
@@ -320,6 +320,11 @@ EOF
|
|||||||
EOF
|
EOF
|
||||||
print_success "新的 CLAUDE.md 已创建"
|
print_success "新的 CLAUDE.md 已创建"
|
||||||
|
|
||||||
|
# 清空 README.md
|
||||||
|
print_info "清空 README.md..."
|
||||||
|
> README.md
|
||||||
|
print_success "README.md 已清空"
|
||||||
|
|
||||||
# 创建 Claude Code Router 配置
|
# 创建 Claude Code Router 配置
|
||||||
print_info "配置 Claude Code Router..."
|
print_info "配置 Claude Code Router..."
|
||||||
mkdir -p ~/.claude-code-router
|
mkdir -p ~/.claude-code-router
|
||||||
@@ -394,17 +399,31 @@ EOF
|
|||||||
GIT_USER_NAME=$(read_input "Git 用户名" "")
|
GIT_USER_NAME=$(read_input "Git 用户名" "")
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
print_info "设置 Git 全局配置..."
|
git init
|
||||||
|
git config init.defaultBranch main
|
||||||
|
print_info "设置 Git 用户配置..."
|
||||||
git config user.email "$GIT_USER_EMAIL"
|
git config user.email "$GIT_USER_EMAIL"
|
||||||
git config user.name "$GIT_USER_NAME"
|
git config user.name "$GIT_USER_NAME"
|
||||||
print_success "Git 全局配置已设置"
|
print_success "Git 用户配置已设置"
|
||||||
|
|
||||||
# 初始化新的 git 仓库
|
# 初始化新的 git 仓库
|
||||||
print_info "初始化 Git 仓库..."
|
print_info "初始化 Git 仓库..."
|
||||||
git init
|
|
||||||
git add .
|
git add .
|
||||||
git commit -m "init"
|
git commit -m "init"
|
||||||
print_success "Git 仓库已初始化并完成首次提交"
|
git branch -M main
|
||||||
|
print_success "Git 仓库已初始化并完成首次提交 (主分支: main)"
|
||||||
|
|
||||||
|
# 配置远程仓库
|
||||||
|
echo ""
|
||||||
|
print_info "配置远程仓库 (格式: https://用户名:密码@gitea.example.com/用户名/仓库名.git)"
|
||||||
|
GIT_REMOTE_URL=$(read_input "远程仓库链接" "" "true")
|
||||||
|
|
||||||
|
if [ -n "$GIT_REMOTE_URL" ]; then
|
||||||
|
git remote add origin "$GIT_REMOTE_URL"
|
||||||
|
print_success "远程仓库已配置: $GIT_REMOTE_URL"
|
||||||
|
else
|
||||||
|
print_info "跳过远程仓库配置"
|
||||||
|
fi
|
||||||
|
|
||||||
# ==================== 完成提示 ====================
|
# ==================== 完成提示 ====================
|
||||||
print_header "配置完成!"
|
print_header "配置完成!"
|
||||||
|
|||||||
Reference in New Issue
Block a user