Skip to content

Commit d1e3720

Browse files
committed
Make custom tag folder search recursive
closes #139
1 parent c9ef9db commit d1e3720

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/custom_tag_index/custom_tag_index.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@
1010

1111
def index(custom_tag_path):
1212
custom_tags = {}
13-
for path in os.listdir(custom_tag_path):
14-
if path.endswith(".cfm") or path.endswith(".cfc"):
15-
full_file_path = custom_tag_path.replace("\\", "/") + "/" + path
16-
file_index = index_file(full_file_path)
17-
if file_index:
18-
custom_tags[full_file_path] = file_index
13+
for path, directories, filenames in os.walk(custom_tag_path):
14+
for filename in filenames:
15+
if filename.endswith(".cfm") or filename.endswith(".cfc"):
16+
full_file_path = path.replace("\\", "/") + "/" + filename
17+
file_index = index_file(full_file_path)
18+
if file_index:
19+
custom_tags[full_file_path] = file_index
1920
return custom_tags
2021

2122

0 commit comments

Comments
 (0)