瀏覽代碼

Update: 2025-06-03T09:54:41

max 2 月之前
父節點
當前提交
7acb100316
共有 1 個文件被更改,包括 15 次插入3 次删除
  1. 15 3
      push.sh

+ 15 - 3
push.sh

@@ -1,5 +1,17 @@
 #!/bin/sh
-time=$(TZ=UTC-8 date +%Y-%m-%d" "%H:%M:%S)
+
+# time=$(TZ=UTC-8 date +%Y-%m-%d" "%H:%M:%S)
+# git add . &&
+# git commit -m "$time" && 
+# git push
+
+# 使用 ISO-8601 格式的时间戳,更标准且避免空格问题
+timestamp=$(TZ=UTC-8 date +"%Y-%m-%dT%H:%M:%S")
+
+# 添加错误处理,任何一步失败则停止执行
 git add . &&
-git commit -m "$time" && 
-git push
+git commit -m "Update: $timestamp" &&
+git push || {
+    echo "Error: Git operation failed" >&2
+    exit 1
+}