ff
This commit is contained in:
@@ -599,27 +599,34 @@ def main() -> int:
|
||||
installed = _is_installed()
|
||||
while True:
|
||||
print("\nMedeia-Macina bootstrap - interactive menu")
|
||||
if installed:
|
||||
print("1) Install / Reinstall")
|
||||
print("2) Uninstall")
|
||||
print("3) Status")
|
||||
print("2) Extras")
|
||||
if installed:
|
||||
print("3) Uninstall")
|
||||
print("4) Status")
|
||||
print("q) Quit")
|
||||
|
||||
choice = input("Choose an option: ").strip().lower()
|
||||
if not choice or choice in ("1", "install", "reinstall"):
|
||||
|
||||
if choice in ("1", "install", "reinstall"):
|
||||
return "install"
|
||||
if choice in ("2", "uninstall"):
|
||||
|
||||
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 choice in ("3", "status"):
|
||||
|
||||
if installed and choice in ("4", "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
|
||||
except EOFError:
|
||||
@@ -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":
|
||||
|
||||
@@ -806,6 +806,29 @@ def main(argv: Optional[list[str]] = None) -> int:
|
||||
if args.verbose:
|
||||
logging.getLogger().setLevel(logging.DEBUG)
|
||||
|
||||
# Interactive setup for root and name if not provided and in a TTY
|
||||
# We check sys.argv directly to see if the flags were explicitly passed.
|
||||
if sys.stdin.isatty() and not any(arg in sys.argv for arg in ["--root", "-r", "--dest-name", "-d"]):
|
||||
print("\nHydrusNetwork Setup")
|
||||
print("--------------------")
|
||||
|
||||
# Ask for root path
|
||||
default_root = Path.home()
|
||||
try:
|
||||
root_input = input(f"Enter root directory for Hydrus installation [default: {default_root}]: ").strip()
|
||||
if root_input:
|
||||
args.root = root_input
|
||||
else:
|
||||
args.root = str(default_root)
|
||||
|
||||
# Ask for destination folder name
|
||||
dest_input = input(f"Enter folder name for Hydrus [default: hydrusnetwork]: ").strip()
|
||||
if dest_input:
|
||||
args.dest_name = dest_input
|
||||
except (EOFError, KeyboardInterrupt):
|
||||
print("\nSetup cancelled.")
|
||||
return 0
|
||||
|
||||
root = Path(args.root).expanduser().resolve()
|
||||
# Python executable inside the repo venv (set when we create/find the venv)
|
||||
venv_py = None
|
||||
|
||||
Reference in New Issue
Block a user