Skip to content

Commit

Permalink
Update main.py
Browse files Browse the repository at this point in the history
  • Loading branch information
nx10 authored Apr 24, 2024
1 parent d8fc966 commit ffcb48b
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions src/styx/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,20 +111,22 @@ def main() -> None:

with open(json_path, "r", encoding="utf-8") as json_file:
json_data = json.load(json_file)

code = compile_boutiques_dict(json_data, settings)

if settings.output_path:
output_path = settings.output_path / pathlib.Path(*output_module_path)
output_path.mkdir(parents=True, exist_ok=True)
output_path = output_path / output_file_name
with open(output_path, "w") as py_file:
py_file.write(code)
print(f"Compiled {json_path} to {output_path}")
else:
print(f"Compiled {json_path} -> {pathlib.Path(*output_module_path) / output_file_name}: {'---' * 10}")
print(code)
print("---" * 10)
try:
code = compile_boutiques_dict(json_data, settings)

if settings.output_path:
output_path = settings.output_path / pathlib.Path(*output_module_path)
output_path.mkdir(parents=True, exist_ok=True)
output_path = output_path / output_file_name
with open(output_path, "w") as py_file:
py_file.write(code)
print(f"Compiled {json_path} to {output_path}")
else:
print(f"Compiled {json_path} -> {pathlib.Path(*output_module_path) / output_file_name}: {'---' * 10}")
print(code)
print("---" * 10)
except:
print(f"Skipped: {json_path}")


if __name__ == "__main__":
Expand Down

0 comments on commit ffcb48b

Please sign in to comment.