From bca2648196c2e155d990f528eff53a5f57be894e Mon Sep 17 00:00:00 2001 From: teutat3s <10206665+teutat3s@users.noreply.github.com> Date: Mon, 19 Aug 2024 11:21:05 +0200 Subject: [PATCH] sync: fix initial sync --- watson/version.py | 2 +- watson/watson.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/watson/version.py b/watson/version.py index 4c22740..334e29d 100644 --- a/watson/version.py +++ b/watson/version.py @@ -1 +1 @@ -version = "2.1.0" +version = "3.0.0" diff --git a/watson/watson.py b/watson/watson.py index 52460f4..3f39be2 100644 --- a/watson/watson.py +++ b/watson/watson.py @@ -452,18 +452,18 @@ def push(self, last_pull): json.dump(frames, f, indent=2) # Check if anything has changed + cwd = self.sync_dir try: - command = ['git', 'diff', '--quiet'] - subprocess.run(command, cwd=self.sync_dir, check=True) + subprocess.run(['git', 'add', 'frames'], cwd=cwd, check=True) + command = ['git', 'diff', '--staged', '--quiet'] + subprocess.run(command, cwd=cwd, check=True) return 0 except subprocess.CalledProcessError: pass # git push - cwd = self.sync_dir updated = len(frames) - n_frames msg = f'Add {updated} frames ({datetime.datetime.now()})' - subprocess.run(['git', 'add', 'frames'], cwd=cwd, check=True) subprocess.run(['git', 'commit', '-m', msg], cwd=cwd, check=True) subprocess.run(['git', 'push'], cwd=cwd, check=True)