Skip to content

Commit

Permalink
auto configure include now has priority over exclude
Browse files Browse the repository at this point in the history
  • Loading branch information
Toilal committed May 28, 2019
1 parent 1d175af commit 9c64560
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ options:
default-directory-mode-beta: 755
```

this will create a synchronisation project for `project-dev1` and `project-dev2` (`exclude` has priority other `include`).
this will create a synchronisation project for `project-dev1` and `project-dev2` (`include` has priority other `exclude`).

By default, if a configuration file is present in a project directory, it is still used to create the
synchronisation project. You can ignore those configuration files with `ignore_project_configuration` to let auto
Expand Down
14 changes: 7 additions & 7 deletions mutagen_helper/scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,6 @@ def configuration_files(path):


def _path_matches(item, include=None, exclude=None):
if exclude:
if isinstance(exclude, bool):
return not exclude
else:
for exclude_item in exclude:
if fnmatch.fnmatch(item, exclude_item):
return False
if include:
if isinstance(include, bool):
return True
Expand All @@ -45,6 +38,13 @@ def _path_matches(item, include=None, exclude=None):
if fnmatch.fnmatch(item, include_item):
return True
return False
if exclude:
if isinstance(exclude, bool):
return not exclude
else:
for exclude_item in exclude:
if fnmatch.fnmatch(item, exclude_item):
return False
return True


Expand Down

0 comments on commit 9c64560

Please sign in to comment.