This commit is contained in:
2026-01-11 11:11:32 -08:00
parent 234f7aca5c
commit fa9f765089
2 changed files with 65 additions and 22 deletions

View File

@@ -599,29 +599,36 @@ def main() -> int:
installed = _is_installed()
while True:
print("\nMedeia-Macina bootstrap - interactive menu")
print("1) Install / Reinstall")
print("2) Extras")
if installed:
print("1) Install / Reinstall")
print("2) Uninstall")
print("3) Status")
print("q) Quit")
choice = input("Choose an option: ").strip().lower()
if not choice or choice in ("1", "install", "reinstall"):
return "install"
if choice in ("2", "uninstall"):
return "uninstall"
if choice in ("3", "status"):
print("Installation detected." if installed else "Not installed.")
continue
if choice in ("q", "quit", "exit"):
return 0
else:
print("1) Install")
print("q) Quit")
choice = input("Choose an option: ").strip().lower()
if not choice or choice in ("1", "install"):
return "install"
if choice in ("q", "quit", "exit"):
return 0
print("3) Uninstall")
print("4) Status")
print("q) Quit")
choice = input("Choose an option: ").strip().lower()
if choice in ("1", "install", "reinstall"):
return "install"
if choice in ("2", "extras"):
print("\nExtras Menu:")
print(" 1) HydrusNetwork (Setup & Clone)")
print(" b) Back")
extra_choice = input("Choose an extra: ").strip().lower()
if extra_choice == "1":
return "extras_hydrus"
continue # back to main menu
if installed and choice in ("3", "uninstall"):
return "uninstall"
if installed and choice in ("4", "status"):
print("Installation detected." if installed else "Not installed.")
continue
if choice in ("q", "quit", "exit"):
return 0
except EOFError:
# Non-interactive, fall back to delegating to platform helper
return "delegate"
@@ -780,6 +787,19 @@ def main() -> int:
args.skip_deps = False
args.install_editable = True
args.no_playwright = False
elif sel == "extras_hydrus":
# Special case: run the hydrusnetwork.py script and then exit
hydrus_script = repo_root / "scripts" / "hydrusnetwork.py"
if hydrus_script.exists():
try:
subprocess.check_call([sys.executable, str(hydrus_script)])
except subprocess.CalledProcessError:
print("\nHydrusNetwork setup exited with an error.")
except Exception as e:
print(f"\nFailed to run HydrusNetwork setup: {e}")
else:
print(f"\nError: {hydrus_script} not found.")
return 0
elif sel == "uninstall":
return _do_uninstall()
elif sel == "delegate":