Skip to content

Commit

Permalink
Add feature to allow local sync to overwrite server
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Dec 12, 2024
1 parent 9e56857 commit f69c1f3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions watson/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1534,9 +1534,10 @@ def config(context, key, value, edit):


@cli.command()
@click.option('-l', '--force-local', is_flag=True, help="Force local will overwrite server")
@click.pass_obj
@catch_watson_error
def sync(watson):
def sync(watson, force_local):
"""
Get the frames from the server and push the new ones.
Expand All @@ -1556,8 +1557,9 @@ def sync(watson):
Pushed 23 frames to the server
"""
last_pull = arrow.utcnow()
pulled = watson.pull()
click.secho(f'Received {pulled} frames from the server.', fg='green')
if not force_local:
pulled = watson.pull()
click.secho(f'Received {pulled} frames from the server.', fg='green')

pushed = watson.push(last_pull)
click.secho(f'Pushed {pushed} frames to the server.', fg='green')
Expand Down

0 comments on commit f69c1f3

Please sign in to comment.