Skip to content

Commit

Permalink
[68] fix for #1067
Browse files Browse the repository at this point in the history
  • Loading branch information
meisnate12 committed Oct 2, 2022
1 parent a1ed06c commit 5c52d77
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.17.3-develop67
1.17.3-develop68
13 changes: 10 additions & 3 deletions modules/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,20 +80,27 @@ def get_file_name(self):
if "/" in data:
if data.endswith(".yml"):
return data[data.rfind("/") + 1:-4]
elif data.endswith(".yaml"):
return data[data.rfind("/") + 1:-5]
else:
return data[data.rfind("/") + 1:]
elif "\\" in data:
if data.endswith(".yml"):
return data[data.rfind("\\") + 1:-4]
elif data.endswith(".yaml"):
return data[data.rfind("/") + 1:-5]
else:
return data[data.rfind("\\") + 1:]
else:
return data

def load_file(self, file_type, file_path, library_type=None, overlay=False, translation=False):
if translation and file_path.endswith(".yml"):
file_path = file_path[:-4]
if not translation and not file_path.endswith(".yml"):
if translation:
if file_path.endswith(".yml"):
file_path = file_path[:-4]
elif file_path.endswith(".yaml"):
file_path = file_path[:-5]
if not translation and not file_path.endswith((".yml", ".yaml")):
file_path = f"{file_path}.yml"
if file_type in ["URL", "Git", "Repo"]:
if file_type == "Repo" and not self.config.custom_repo:
Expand Down
5 changes: 3 additions & 2 deletions modules/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,11 +440,12 @@ def check_dict(attr, name):
elif not os.path.isdir(file["folder"]):
logger.error(f"Config Error: Folder not found: {file['folder']}")
else:
yml_files = glob_filter(os.path.join(file["folder"], f"*.yml"))
yml_files = glob_filter(os.path.join(file["folder"], "*.yml"))
yml_files.extend(glob_filter(os.path.join(file["folder"], "*.yaml")))
if yml_files:
current.extend([("File", yml, temp_vars, asset_directory) for yml in yml_files])
else:
logger.error(f"Config Error: No YAML (.yml) files found in {file['folder']}")
logger.error(f"Config Error: No YAML (.yml|.yaml) files found in {file['folder']}")

if schedule and "schedule" in file and file["schedule"]:
current_time, run_hour, ignore_schedules = schedule
Expand Down

0 comments on commit 5c52d77

Please sign in to comment.