2026-03-26 Learning Log
- The one-click update script is in place on my computer now, so I don't have to type commands line by line anymore
Automated site building: the one-click update script
To make updates faster, I wrote a Windows batch script (.bat). Double-click it and it handles staging, committing, and pushing to the GitHub repo on its own.
📄 Script code (update.bat)
batch
@echo off
:: Set encoding to UTF-8 to avoid garbled Chinese characters
chcp 65001 >nul
title Updating my academic homepage...
echo ---------------------------------------
echo 🚀 Starting sync to GitHub...
echo ---------------------------------------
:: 1. Stage all changes
git add .
:: 2. Auto-commit with the current date and time in the message
set msg=Update at %date% %time%
git commit -m "%msg%"
:: 3. Push to the cloud (this repo's main branch is master; repos created on GitHub after 2020 default to main, so check your branch name before copying)
echo 📤 Uploading, please wait...
git push origin master
echo ---------------------------------------
echo ✅ Done! Code pushed to GitHub successfully.
echo 🌐 Vercel is building the new version in the background...
echo ---------------------------------------
pauseThis is the earliest version. The one actually in use in the repo now is
update一键更新.bat, which does three extra things: it runs the translation scriptnpm run translate, it doesgit pull --rebasefirst to merge in remote changes, and it stops and reports an error at any failed step instead of carrying on.