From d8da43fc819fe9d644c6ad392b725f818332afcd Mon Sep 17 00:00:00 2001 From: yunyun <1159428885@qq.com> Date: Sat, 30 May 2026 04:38:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20README.md=20.gitignore=20p?= =?UTF-8?q?ush.bat=20start.bat?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | Bin 0 -> 70 bytes push.bat | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++++ start.bat | 5 ++++ 3 files changed, 85 insertions(+) create mode 100644 .gitignore create mode 100644 push.bat create mode 100644 start.bat diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..a84eceb32abba1c6106775e3ae7f6fdffa3a061f GIT binary patch literal 70 zcmezWFOMOgA%!88A)X-@%qnHb0rH9&^ci>=xPWvCLn1>Fkkn&H0nul +setlocal enabledelayedexpansion + +cd /d "C:\Users\yunyun\Desktop\111\ClassroomAssistant" + +echo ================================================= +echo 当前目录: %cd% +echo ================================================= + +echo. +echo [1/5] 检查更改文件... +git status --short +echo. + +echo [2/5] 显示文件差异统计... +git diff --stat +echo. + +:: 修复:正确提取修改的文件名 +set "fileList=" +for /f "usebackq tokens=1,*" %%a in (`git status --short`) do ( + set "filename=%%b" + if not "!filename!"=="" ( + if "!fileList!"=="" ( + set "fileList=!filename!" + ) else ( + set "fileList=!fileList! !filename!" + ) + ) +) + +:: 询问用户输入 +set /p userInput="请输入提交摘要(直接回车则自动生成): " + +:: 如果用户有输入,使用用户输入;否则自动生成 +if not "%userInput%"=="" ( + set "commitTitle=%userInput%" + set "commitBody=" +) else ( + if "!fileList!"=="" ( + echo. + echo 没有检测到任何文件更改。 + echo 可能的情况: + echo 1. 所有修改已经提交过了 + echo 2. 确实没有修改任何文件 + echo. + pause + exit /b + ) + set "autoMsg=更新 !fileList!" + + :: 截断逻辑:标题最多50字符 + set "commitTitle=!autoMsg!" + set "commitBody=" + if not "!commitTitle:~50!"=="" ( + set "commitTitle=!autoMsg:~0,50!" + set "commitBody=!autoMsg!" + ) +) + +echo. +echo [3/5] 添加所有更改... +git add . + +echo. +echo [4/5] 提交到本地仓库... +if "!commitBody!"=="" ( + git commit -m "!commitTitle!" +) else ( + git commit -m "!commitTitle!" -m "!commitBody!" +) + +echo. +echo [5/5] 推送到远程服务器... +git push + +echo. +echo 完成! +pause \ No newline at end of file diff --git a/start.bat b/start.bat new file mode 100644 index 0000000..c4c6aea --- /dev/null +++ b/start.bat @@ -0,0 +1,5 @@ +@echo off +cd /d "%~dp0" +set TZ=Asia/Shanghai +start /min cmd /c "npm start >nul 2>&1 & exit" +exit \ No newline at end of file