Skip to content

Commit

Permalink
allow common/repo.yaml for better config file
Browse files Browse the repository at this point in the history
  • Loading branch information
DerGoogler committed Dec 20, 2024
1 parent 4ddce75 commit 2ff26cb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ python-dateutil>=2.8.2
requests>=2.31.0
tabulate>=0.9.0
gitpython>=3.1.37
validators>=0.28.3
validators>=0.28.3
pyyaml>=6.0.2
7 changes: 6 additions & 1 deletion sync/model/LocalModule.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
import yaml
from zipfile import ZipFile
from pathlib import Path

Expand Down Expand Up @@ -105,7 +106,11 @@ def load(cls, file, track, config):
local_module[key] = value

try:
raw_json = json.loads(cls.file_read("common/repo.json"))
has_yaml = cls.file_exist("common/repo.yaml")
if has_yaml:
raw_json = yaml.load(cls.file_read("common/repo.yaml"), Loader=yaml.FullLoader)
else:
raw_json = json.loads(cls.file_read("common/repo.json"))
raw_json = cls.clean_json(raw_json) # Clean the raw JSON data

for item in raw_json.items():
Expand Down

0 comments on commit 2ff26cb

Please sign in to comment.