Skip to content

Commit

Permalink
备份新的懒人包脚本
Browse files Browse the repository at this point in the history
  • Loading branch information
Ikaros-521 committed Jul 2, 2023
1 parent 04f25f0 commit e11529d
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Scripts/1.GUI运行.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@echo off
Miniconda3\python.exe main.py
27 changes: 27 additions & 0 deletions Scripts/3.conda初始化配置.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
@echo off

rem 获取当前系统用户的用户名
for /f %%i in ('whoami') do set "USERNAME=%%i"

rem 如果无法获取用户名,则默认使用 "Administrator"
if "%USERNAME%"=="" set "USERNAME=Administrator"

rem 设置 Conda 配置文件路径
set "CONDARC_PATH=C:\Users\%USERNAME%\.condarc"

rem 检查配置文件是否已存在
if exist "!CONDARC_PATH!" (
echo Conda 配置文件已存在,无需初始化。
exit /b
)

rem 创建 Conda 配置文件
echo 创建 Conda 配置文件...
echo channels: > "!CONDARC_PATH!"
echo - defaults >> "!CONDARC_PATH!"

rem 初始化 Conda
echo 初始化 Conda...
conda init

echo Conda 配置文件初始化完成。
10 changes: 10 additions & 0 deletions Scripts/4.激活conda环境.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@echo off
chcp 65001
color 0a
set CONDA=%~dp0\Miniconda3\condabin\conda.bat
call %CONDA% config --add channels conda-forge
call %CONDA% config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
call %CONDA% config --set show_channel_urls yes
cls
call %CONDA% info
cmd "/K" %~dp0\Miniconda3\Scripts\activate.bat %~dp0\Miniconda3
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@echo off
chcp 65001
where git > nul 2>&1
if %errorlevel% neq 0 (
echo Git 命令没找到,请先安装git客户端.
pause
exit /b
)

git fetch --all
git reset --hard origin/main
echo 拉取完毕(如果没报错的话).
pause
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@echo off
chcp 65001
where git > nul 2>&1
if %errorlevel% neq 0 (
echo Git 命令没找到,请先安装git客户端.
pause
exit /b
)
git pull origin main
echo 拉取完毕(如果没报错的话).
pause

0 comments on commit e11529d

Please sign in to comment.