Skip to content

Commit fb46daa

Browse files
committed
Ignore all files starting with leading dot (.) or ending in tilde (~)
1 parent ce1639f commit fb46daa

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/qfieldcloud_sdk/sdk.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ def list_local_files(
598598
) -> List[Dict[str, Any]]:
599599
"""
600600
Returns a list of dicts with information about local files. Usually used before uploading files.
601-
NOTE: files and dirs starting with leading zero in the root directory will be ignored.
601+
NOTE: files and dirs starting with leading dot (.) or ending in tilde (~) will be ignored.
602602
"""
603603
if not filter_glob:
604604
filter_glob = "*"
@@ -608,7 +608,8 @@ def list_local_files(
608608
if not path.is_file():
609609
continue
610610

611-
if str(path.relative_to(root_path)).startswith("."):
611+
basename = path.relative_to(root_path).name
612+
if basename.startswith(".") or basename.endswith("~"):
612613
continue
613614

614615
relative_name = path.relative_to(root_path)

0 commit comments

Comments
 (0)