|
@@ -1,17 +1,5 @@
|
|
|
#!/bin/sh
|
|
|
-
|
|
|
-# 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")
|
|
|
-
|
|
|
-# 添加错误处理,任何一步失败则停止执行
|
|
|
+time=$(TZ=UTC-8 date +%Y-%m-%d" "%H:%M:%S)
|
|
|
git add . &&
|
|
|
-git commit -m "Update: $timestamp" &&
|
|
|
-GIT_SSH_COMMAND="ssh -i ~/.ssh/gitee" git push || {
|
|
|
- echo "Error: Git operation failed" >&2
|
|
|
- exit 1
|
|
|
-}
|
|
|
+git commit -m "$time" &&
|
|
|
+git push
|