Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

Commit

Permalink
Fix generate-index to deal with leftover folders.
Browse files Browse the repository at this point in the history
  • Loading branch information
emackey committed Jan 24, 2020
1 parent e50a688 commit 6262fd6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions generate-index.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ def generate_index(root):
gltf_variant_dirs = [d for d in model_contents if d.startswith("glTF")]
variants = {}
for variant_dir in gltf_variant_dirs:
model_file = [f for f in os.listdir(variant_dir)
if f.endswith(".glb") or f.endswith(".gltf")][0]
variants[variant_dir] = model_file
model_file_list = [f for f in os.listdir(variant_dir)
if f.endswith(".glb") or f.endswith(".gltf")]
if (len(model_file_list) > 0):
variants[variant_dir] = model_file_list[0]
if not variants:
print ("WARNING: no model files found for {}".format(model))
else:
Expand Down

0 comments on commit 6262fd6

Please sign in to comment.