Skip to content

Commit

Permalink
Ignore hidden files and folders
Browse files Browse the repository at this point in the history
  • Loading branch information
mzfr committed Dec 10, 2018
1 parent 710c192 commit 04856cd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion kodi_addon_checker/handle_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,14 @@ def create_file_index(path: str):
"""
file_index = []
for root, folders, files in os.walk(path, topdown=True):
if ".directory" in files:
files.remove(".directory")
if ".git" in folders:
folders.remove(".git")
for file_name in files:
file_index.append({"path": root, "name": file_name})
if not os.path.basename(root).startswith("."):
file_index.append({"path": root, "name": file_name})

return file_index


Expand Down

0 comments on commit 04856cd

Please sign in to comment.