From 4870541f6c282b7e7e56780b355bc23196f75b57 Mon Sep 17 00:00:00 2001 From: zl jiao <2506513065@qq.com> Date: Sun, 19 Dec 2021 20:54:41 +0800 Subject: [PATCH 1/2] update --- auto_sync_tool/auto_sync_to_git.py | 3 ++- auto_sync_tool/crontab_task.conf | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/auto_sync_tool/auto_sync_to_git.py b/auto_sync_tool/auto_sync_to_git.py index 678e9a0..a4b279d 100755 --- a/auto_sync_tool/auto_sync_to_git.py +++ b/auto_sync_tool/auto_sync_to_git.py @@ -159,9 +159,10 @@ if __name__ == '__main__': if 'MacBook-Air' in DeviceInfo.host_name: syncTool.showDialog = True + print(DeviceInfo.host_name); # 配置需要同步的 仓库 - syncItem02 = AutoSyncItem('/Users/Jiaozl/Codes/study-notes') + syncItem02 = AutoSyncItem('/Users/zljiao/study-notes') syncItem02.allowedCommand = CommandType.git_all syncTool.items.append(syncItem02) diff --git a/auto_sync_tool/crontab_task.conf b/auto_sync_tool/crontab_task.conf index b0e3fdf..263eea3 100644 --- a/auto_sync_tool/crontab_task.conf +++ b/auto_sync_tool/crontab_task.conf @@ -1,8 +1,8 @@ # 每隔 30s 同步执行一次 -*/1 * * * * cd /Users/Jiaozl/Codes/automatic-synchronization-tool/auto_sync_tool && /usr/bin/python ./auto_sync_to_git.py -c -* * * * * sleep 30 && cd /Users/Jiaozl/Codes/automatic-synchronization-tool/auto_sync_tool && /usr/bin/python ./auto_sync_to_git.py -c +*/1 * * * * cd /Users/zljiao/automatic-synchronization-tool/auto_sync_tool && /usr/bin/python ./auto_sync_to_git.py -c +* * * * * sleep 30 && cd /Users/zljiao/automatic-synchronization-tool/auto_sync_tool && /usr/bin/python ./auto_sync_to_git.py -c # 每 10m push 一次 -*/10 * * * * cd /Users/Jiaozl/Codes/automatic-synchronization-tool/auto_sync_tool && /usr/bin/python ./auto_sync_to_git.py -p +*/10 * * * * cd /Users/zljiao/automatic-synchronization-tool/auto_sync_tool && /usr/bin/python ./auto_sync_to_git.py -p -- Gitee From 8c2a7b4b6aeac47a45fb1640718ba85014789c60 Mon Sep 17 00:00:00 2001 From: zl jiao <2506513065@qq.com> Date: Sun, 19 Dec 2021 21:03:23 +0800 Subject: [PATCH 2/2] update --- auto_sync_tool/auto_sync_to_git.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auto_sync_tool/auto_sync_to_git.py b/auto_sync_tool/auto_sync_to_git.py index a4b279d..bffe731 100755 --- a/auto_sync_tool/auto_sync_to_git.py +++ b/auto_sync_tool/auto_sync_to_git.py @@ -89,7 +89,7 @@ class AutoSyncToGitTool: text = self.git_status(item) shouldPull = False if "is behind" in text: # 本地比远端要新,可以直接 push - shouldPull = TRUE + shouldPull = True elif "different commits each" in text: # 远端有更新,本地有未提交的修改,需要手动解决 self.show_dialog_tips(item) return shouldPull -- Gitee