Skip to content

Commit

Permalink
Ignore hidden files and directories when searching
Browse files Browse the repository at this point in the history
  • Loading branch information
psss committed Feb 19, 2018
1 parent af70fce commit e38e78b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions fmf/base.py
Expand Up @@ -102,8 +102,10 @@ def grow(self, path):
filenames.insert(0, filenames.pop(filenames.index(MAIN)))
except ValueError:
pass
# Check every metadata file and load data
# Check every metadata file and load data (ignore hidden)
for filename in filenames:
if filename.startswith("."):
continue
fullpath = os.path.join(dirpath, filename)
log.info("Checking file {0}".format(fullpath))
with open(fullpath) as datafile:
Expand All @@ -113,8 +115,10 @@ def grow(self, path):
self.update(data)
else:
self.child(os.path.splitext(filename)[0], data)
# Explore every child directory
# Explore every child directory (ignore hidden)
for dirname in sorted(dirnames):
if dirname.startswith("."):
continue
self.child(dirname, os.path.join(path, dirname))

def climb(self, whole=False):
Expand Down

0 comments on commit e38e78b

Please sign in to comment.