Skip to content

Commit

Permalink
sync: fix initial sync
Browse files Browse the repository at this point in the history
  • Loading branch information
teutat3s committed Aug 19, 2024
1 parent 8cb7666 commit bca2648
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion watson/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = "2.1.0"
version = "3.0.0"
8 changes: 4 additions & 4 deletions watson/watson.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit bca2648

Please sign in to comment.