-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
50 lines (41 loc) · 1.46 KB
/
Copy pathsetup.sh
File metadata and controls
50 lines (41 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
# AI导航网站设置脚本
echo "=== AI导航网站设置脚本 ==="
echo "这个脚本将帮助您设置AI导航网站并推送到GitHub。"
echo ""
# 检查git是否安装
if ! command -v git &> /dev/null; then
echo "错误:未安装git,请先安装git后再运行此脚本。"
exit 1
fi
# 询问GitHub用户名
read -p "请输入您的GitHub用户名: " github_username
if [ -z "$github_username" ]; then
echo "错误:GitHub用户名不能为空。"
exit 1
fi
# 询问仓库名称
read -p "请输入您要创建的GitHub仓库名称 (默认: ai-nav-site): " repo_name
repo_name=${repo_name:-"ai-nav-site"}
# 更新文件中的GitHub用户名
echo "正在更新文件中的GitHub用户名..."
sed -i "s/您的用户名/$github_username/g" README.md
sed -i "s/您的用户名/$github_username/g" index.html
# 创建静态资源目录
mkdir -p static
echo "静态资源目录已创建。"
# 初始化git仓库
git init
git add .
git commit -m "初始化AI导航网站"
# 创建GitHub仓库
echo "请在GitHub上创建一个名为 $repo_name 的新仓库,然后运行以下命令:"
echo ""
echo " git remote add origin https://github.com/$github_username/$repo_name.git"
echo " git branch -M main"
echo " git push -u origin main"
echo ""
echo "完成上述步骤后,您的AI导航网站将可以通过以下地址访问:"
echo "https://$github_username.github.io/$repo_name"
echo ""
echo "注意:可能需要几分钟时间进行部署。"