From efea6bf64e8b3dfa60703bb78812455da35faebc Mon Sep 17 00:00:00 2001 From: hao Date: Mon, 16 Mar 2026 22:17:35 -0700 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0:=202=20=E4=B8=AA=E6=96=87?= =?UTF-8?q?=E4=BB=B6=20-=202026-03-16=2022:17:35?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .sync-gitea-cron.log | 8 ++++++++ scripts/sync-gitea.sh | 5 +++-- 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 .sync-gitea-cron.log diff --git a/.sync-gitea-cron.log b/.sync-gitea-cron.log new file mode 100644 index 00000000..cf9b4c46 --- /dev/null +++ b/.sync-gitea-cron.log @@ -0,0 +1,8 @@ +[INFO] 初始化 Git 仓库... +[WARNING] Git 仓库已存在 +[INFO] 远程仓库 URL 已更新 +[INFO] 远程仓库已存在: hao/websafe-kb +[WARNING] 未提供 GITEA_TOKEN;推送时将使用本机已有认证方式 +[SUCCESS] 初始化完成 +[INFO] 检查更改... +/Users/x/websafe/scripts/sync-gitea.sh: line 136: $1: unbound variable diff --git a/scripts/sync-gitea.sh b/scripts/sync-gitea.sh index 4d12b9ef..8f62b2ff 100755 --- a/scripts/sync-gitea.sh +++ b/scripts/sync-gitea.sh @@ -133,8 +133,9 @@ commit_changes() { local commit_msg="更新: ${changed_files} 个文件 - ${timestamp}" # 如果提供了自定义提交信息 - if [ -n "$1" ]; then - commit_msg="$1" + local custom_msg="${1:-}" + if [ -n "$custom_msg" ]; then + commit_msg="$custom_msg" fi git commit -m "$commit_msg"