Skip to content

Commit

Permalink
Added ignore to ignore directories when their metadata changes. (#25)
Browse files Browse the repository at this point in the history
* Added ignore to ignore directories when their metadata changes.

* code review

---------

Co-authored-by: Falko Schindler <[email protected]>
  • Loading branch information
SeaTechRC and falkoschindler authored Mar 21, 2024
1 parent 202adea commit 9f2da9f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion livesync/folder.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ def _get_ignores(self) -> List[str]:
path = self.source_path / '.syncignore'
if not path.is_file():
path.write_text('\n'.join(self.DEFAULT_IGNORES))
return [line.strip() for line in path.read_text().splitlines() if not line.startswith('#')]
ignores = [line.strip() for line in path.read_text().splitlines() if not line.startswith('#')]
ignores += [ignore.rstrip('/\\') for ignore in ignores if ignore.endswith('/') or ignore.endswith('\\')]
return ignores

def get_summary(self) -> str:
summary = f'{self.source_path} --> {self.target}\n'
Expand Down

0 comments on commit 9f2da9f

Please sign in to comment.