Skip to content

Commit cc17e31

Browse files
committed
feat: added --force to the CLI upload_files to skip etag verification
Also added a bit of typing
1 parent 1ad452d commit cc17e31

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

qfieldcloud_sdk/cli.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,20 @@ def delete_project(ctx: Context, project_id):
326326
"--throw-on-error/--no-throw-on-error",
327327
help="If any project file upload fails stop uploading the rest. Default: False",
328328
)
329+
@click.option(
330+
"--force/--no-force",
331+
help="Upload file even if it already exists remotely. Default: False",
332+
default=False,
333+
)
329334
@click.pass_context
330-
def upload_files(ctx: Context, project_id, project_path, filter_glob, throw_on_error):
335+
def upload_files(
336+
ctx: Context,
337+
project_id: str,
338+
project_path: str,
339+
filter_glob: str,
340+
throw_on_error: bool,
341+
force: bool,
342+
) -> None:
331343
"""Upload files to a QFieldCloud project."""
332344

333345
files = ctx.obj["client"].upload_files(
@@ -337,6 +349,7 @@ def upload_files(ctx: Context, project_id, project_path, filter_glob, throw_on_e
337349
filter_glob=filter_glob,
338350
throw_on_error=throw_on_error,
339351
show_progress=True,
352+
force=force,
340353
)
341354

342355
if ctx.obj["format_json"]:

0 commit comments

Comments
 (0)