Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Add ability to force local changes over server during sync #18

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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