Skip to content

Commit

Permalink
fix: Ignore .tmpl when parsing folder
Browse files Browse the repository at this point in the history
Ignore .tmpl file when parsing with `--input` set to folder. Without this change, when parsing `~/.edam`, edam failed as it tried to parse the same template.
This commit closes #51
  • Loading branch information
argysamo committed Aug 5, 2022
1 parent d96e1d9 commit 96853ba
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions edam/reader/resolvers/resolver_factory.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import fnmatch
import os
from enum import Enum
from os.path import expanduser
Expand Down Expand Up @@ -157,6 +158,9 @@ def resolver(self) -> List[Resolver]:
elif self.__input_type is InputType.FOLDER:
resolvers = []
for file in walk_files_in_directory(self.input_uri):
if fnmatch.fnmatch(file, '*.tmpl'):
logger.debug(f"Ignore .tmpl file: {file}")
continue
try:
meta = Metadata(path=self.metadata_file)
temp_resolver = FileResolver(template=self.template,
Expand Down

0 comments on commit 96853ba

Please sign in to comment.