first commit

This commit is contained in:
douboer
2026-03-21 18:57:10 +08:00
commit c49aa1a5e9
570 changed files with 107167 additions and 0 deletions

50
runit.sh Executable file
View File

@@ -0,0 +1,50 @@
#!/bin/bash
set -euo pipefail
LOG_PREFIX="[${LOG_CONTEXT:-RUNIT}]"
if [ -t 1 ]; then
COLOR_RESET=$'\033[0m'
case "${LOG_CONTEXT:-RUNIT}" in
LOCAL)
COLOR_PREFIX=$'\033[1;32m'
;;
REMOTE)
COLOR_PREFIX=$'\033[1;94m'
;;
*)
COLOR_PREFIX=$'\033[1;33m'
;;
esac
else
COLOR_RESET=""
COLOR_PREFIX=""
fi
log() {
echo "${COLOR_PREFIX}${LOG_PREFIX}${COLOR_RESET} $*"
}
log "开始同步远端 main先 pull 再 push..."
git pull --rebase --autostash origin main
log "开始收集本地变更..."
git add -A
msg="update at $(date '+%Y-%m-%d %H:%M:%S')"
if [ $# -gt 0 ]; then
msg="$*"
fi
if git diff --cached --quiet; then
log "没有可提交变更,跳过 commit。"
else
log "开始提交:${msg}"
git commit -m "$msg"
fi
log "开始推送到 origin/main..."
git push origin main
log "runit.sh 执行完成。"