|
@@ -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
|
|
|
+}
|