2026-04-24 22:40:27 -05:00
|
|
|
#+------------------------------------------------------------------+
|
|
|
|
|
#| Imports |
|
|
|
|
|
#+------------------------------------------------------------------+
|
|
|
|
|
# Importamos todo
|
2026-04-25 06:51:23 -05:00
|
|
|
from Src.Comands.Defines import *
|
2026-04-24 22:40:27 -05:00
|
|
|
|
|
|
|
|
#+------------------------------------------------------------------+
|
|
|
|
|
#| Init |
|
|
|
|
|
#+------------------------------------------------------------------+
|
|
|
|
|
@tsndep.command()
|
|
|
|
|
def init():
|
2026-04-25 06:51:23 -05:00
|
|
|
"""Create a dependencies.json with base template"""
|
2026-04-24 22:40:27 -05:00
|
|
|
|
|
|
|
|
json_path: str = os.path.join(os.getcwd(), "dependencies.json")
|
|
|
|
|
repo_name: str = os.path.basename(os.getcwd())
|
|
|
|
|
|
|
|
|
|
# Verificar que no exista
|
|
|
|
|
if os.path.exists(json_path):
|
2026-04-25 06:51:23 -05:00
|
|
|
click.echo(f"[INIT:{repo_name}] dependencies.json already exists", err=True)
|
2026-04-24 22:40:27 -05:00
|
|
|
return
|
|
|
|
|
|
|
|
|
|
# Crear estructura
|
|
|
|
|
template: dict = {
|
|
|
|
|
"repos": [],
|
|
|
|
|
"min_mt5_build": 5830,
|
|
|
|
|
"other_languages": [],
|
|
|
|
|
"hooks": {
|
|
|
|
|
"post_install_only_on_success": True,
|
|
|
|
|
"post_install": [],
|
|
|
|
|
"pre_install": [],
|
|
|
|
|
"pre_update": [],
|
|
|
|
|
"post_update_only_on_success": True,
|
|
|
|
|
"post_update": []
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Guardar
|
|
|
|
|
if JsonV.save_json(json_path, template):
|
2026-04-25 06:51:23 -05:00
|
|
|
click.echo(f"[INIT:{repo_name}] dependencies.json created")
|
|
|
|
|
click.echo(f"[INIT:{repo_name}] Path: {json_path}")
|
2026-04-24 22:40:27 -05:00
|
|
|
else:
|
2026-04-25 06:51:23 -05:00
|
|
|
click.echo(f"[INIT:{repo_name}] Error creating file", err=True)
|