Skip to content

Commit

Permalink
Ignore all files starting with leading dot (.) or ending in tilde (~)
Browse files Browse the repository at this point in the history
  • Loading branch information
suricactus committed Mar 16, 2022
1 parent ce1639f commit fb46daa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/qfieldcloud_sdk/sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ def list_local_files(
) -> List[Dict[str, Any]]:
"""
Returns a list of dicts with information about local files. Usually used before uploading files.
NOTE: files and dirs starting with leading zero in the root directory will be ignored.
NOTE: files and dirs starting with leading dot (.) or ending in tilde (~) will be ignored.
"""
if not filter_glob:
filter_glob = "*"
Expand All @@ -608,7 +608,8 @@ def list_local_files(
if not path.is_file():
continue

if str(path.relative_to(root_path)).startswith("."):
basename = path.relative_to(root_path).name
if basename.startswith(".") or basename.endswith("~"):
continue

relative_name = path.relative_to(root_path)
Expand Down

0 comments on commit fb46daa

Please sign in to comment.