-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.bat
More file actions
50 lines (42 loc) · 1.57 KB
/
Copy pathsetup.bat
File metadata and controls
50 lines (42 loc) · 1.57 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
@echo off
echo === AI导航网站设置脚本 ===
echo 这个脚本将帮助您设置AI导航网站并推送到GitHub。
echo.
REM 检查git是否安装
where git >nul 2>nul
if %ERRORLEVEL% neq 0 (
echo 错误:未安装git,请先安装git后再运行此脚本。
exit /b 1
)
REM 询问GitHub用户名
set /p github_username=请输入您的GitHub用户名:
if "%github_username%"=="" (
echo 错误:GitHub用户名不能为空。
exit /b 1
)
REM 询问仓库名称
set /p repo_name=请输入您要创建的GitHub仓库名称 (默认: ai-nav-site):
if "%repo_name%"=="" set repo_name=ai-nav-site
REM 更新文件中的GitHub用户名
echo 正在更新文件中的GitHub用户名...
powershell -Command "(Get-Content README.md) -replace '您的用户名', '%github_username%' | Set-Content README.md"
powershell -Command "(Get-Content index.html) -replace '您的用户名', '%github_username%' | Set-Content index.html"
REM 创建静态资源目录
if not exist static mkdir static
echo 静态资源目录已创建。
REM 初始化git仓库
git init
git add .
git commit -m "初始化AI导航网站"
REM 创建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 注意:可能需要几分钟时间进行部署。
pause