1 Star 0 Fork 0

wuqingyongwu/codeStore

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
自动提交.bat 1.28 KB
一键复制 编辑 原始数据 按行查看 历史
wuqy1234 提交于 2025-04-22 17:26 +08:00 . 自动提交: 周二 2025/04/22 at 17:26
@echo off
setlocal enabledelayedexpansion
chcp 65001 >nul
set REPO_DIR=%~dp0
cd /d "%REPO_DIR%"
for /f %%a in ("%CD%") do (set task_name=%%~nxa_auto_push)
schtasks /create /tn "!task_name!" /tr "%~f0" /sc daily /st 21:30 /f
for /f "delims=" %%i in ('git status --porcelain') do (
if not "%%i" == "" (
git add .
set TIME=%time:~0,5%
set COMMIT_MSG=自动提交: %DATE% at !TIME!
git commit -m "!COMMIT_MSG!"
git push
schtasks /delete /tn "!task_name!_tomorrow" /f
)
)
for /f "delims=" %%i in ('git status') do (
set aa=%%i
set bb=!aa:~0,23!
if "!bb!"=="Your branch is ahead of" (
for /f "tokens=5 delims=: " %%a in ('netsh wlan show interfaces ^| findstr "SSID"') do (
set "SSID=%%a"
)
if defined SSID (
echo 当前连接的 WiFi 名称为: %SSID%
echo 自动提交失败,每5分钟自动重试一次。
ping -n 300 localhost >nul
echo 开始再次推送更改。
call "%~f0"
) else (
echo 当前未连接任何 WiFi
echo 已创建计划任务,等待明天9:30自动重试。
schtasks /create /tn "!task_name!_tomorrow" /tr "%~f0" /sc daily /st 09:30 /f
)
)
)
endlocal
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wuqingyongwu/code-store.git
git@gitee.com:wuqingyongwu/code-store.git
wuqingyongwu
code-store
codeStore
main

搜索帮助