From f69c1f3f7c931c8af3362fbbe0255ce9083b16e4 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 12 Dec 2024 14:19:32 +0100 Subject: [PATCH] Add feature to allow local sync to overwrite server --- watson/cli.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/watson/cli.py b/watson/cli.py index cc8c593..8edfa2b 100644 --- a/watson/cli.py +++ b/watson/cli.py @@ -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. @@ -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')