f
This commit is contained in:
@@ -780,44 +780,47 @@ def main() -> int:
|
|||||||
print()
|
print()
|
||||||
print("✅ Installation check complete!")
|
print("✅ Installation check complete!")
|
||||||
return 0
|
return 0
|
||||||
if sys.stdin.isatty() and not args.quiet:
|
|
||||||
sel = _interactive_menu()
|
# If no specific action flag is passed and we're in a terminal, show the menu
|
||||||
if sel == "install":
|
if sys.stdin.isatty() and not args.quiet:
|
||||||
# user chose to install/reinstall; set defaults and continue
|
sel = _interactive_menu()
|
||||||
args.skip_deps = False
|
if sel == "install":
|
||||||
args.install_editable = True
|
# user chose to install/reinstall; set defaults and continue
|
||||||
args.no_playwright = False
|
args.skip_deps = False
|
||||||
elif sel == "extras_hydrus":
|
args.install_editable = True
|
||||||
# Special case: run the hydrusnetwork.py script and then exit
|
args.no_playwright = False
|
||||||
hydrus_script = repo_root / "scripts" / "hydrusnetwork.py"
|
elif sel == "extras_hydrus":
|
||||||
if hydrus_script.exists():
|
# Special case: run the hydrusnetwork.py script and then exit
|
||||||
try:
|
hydrus_script = repo_root / "scripts" / "hydrusnetwork.py"
|
||||||
subprocess.check_call([sys.executable, str(hydrus_script)])
|
if hydrus_script.exists():
|
||||||
except subprocess.CalledProcessError:
|
try:
|
||||||
print("\nHydrusNetwork setup exited with an error.")
|
subprocess.check_call([sys.executable, str(hydrus_script)])
|
||||||
except Exception as e:
|
except subprocess.CalledProcessError:
|
||||||
print(f"\nFailed to run HydrusNetwork setup: {e}")
|
print("\nHydrusNetwork setup exited with an error.")
|
||||||
else:
|
except Exception as e:
|
||||||
print(f"\nError: {hydrus_script} not found.")
|
print(f"\nFailed to run HydrusNetwork setup: {e}")
|
||||||
return 0
|
|
||||||
elif sel == "uninstall":
|
|
||||||
return _do_uninstall()
|
|
||||||
elif sel == "delegate":
|
|
||||||
rc = run_platform_bootstrap(repo_root)
|
|
||||||
if rc != 0:
|
|
||||||
return rc
|
|
||||||
if not args.quiet:
|
|
||||||
print("Platform bootstrap completed successfully.")
|
|
||||||
return 0
|
|
||||||
else:
|
else:
|
||||||
return int(sel or 0)
|
print(f"\nError: {hydrus_script} not found.")
|
||||||
else:
|
return 0
|
||||||
|
elif sel == "uninstall":
|
||||||
|
return _do_uninstall()
|
||||||
|
elif sel == "delegate":
|
||||||
rc = run_platform_bootstrap(repo_root)
|
rc = run_platform_bootstrap(repo_root)
|
||||||
if rc != 0:
|
if rc != 0:
|
||||||
return rc
|
return rc
|
||||||
if not args.quiet:
|
if not args.quiet:
|
||||||
print("Platform bootstrap completed successfully.")
|
print("Platform bootstrap completed successfully.")
|
||||||
return 0
|
return 0
|
||||||
|
elif sel == 0:
|
||||||
|
return 0
|
||||||
|
elif not args.no_delegate:
|
||||||
|
# Default non-interactive behavior: delegate to platform script
|
||||||
|
rc = run_platform_bootstrap(repo_root)
|
||||||
|
if rc != 0:
|
||||||
|
return rc
|
||||||
|
if not args.quiet:
|
||||||
|
print("Platform bootstrap completed successfully.")
|
||||||
|
return 0
|
||||||
|
|
||||||
if sys.version_info < (3, 8):
|
if sys.version_info < (3, 8):
|
||||||
print("Warning: Python 3.8+ is recommended.", file=sys.stderr)
|
print("Warning: Python 3.8+ is recommended.", file=sys.stderr)
|
||||||
@@ -1360,7 +1363,7 @@ if (Test-Path (Join-Path $repo 'CLI.py')) {
|
|||||||
'if [ -z "${MM_NO_UPDATE:-}" ] && [ -d "$REPO/.git" ] && command -v git >/dev/null 2>&1; then\n'
|
'if [ -z "${MM_NO_UPDATE:-}" ] && [ -d "$REPO/.git" ] && command -v git >/dev/null 2>&1; then\n'
|
||||||
' AUTO_UPDATE="true"\n'
|
' AUTO_UPDATE="true"\n'
|
||||||
' if [ -f "$REPO/config.conf" ]; then\n'
|
' if [ -f "$REPO/config.conf" ]; then\n'
|
||||||
' if grep -qiE \'auto_update\s*=\s*(false|no|off|0)\' "$REPO/config.conf"; then\n'
|
" if grep -qiE 'auto_update[[:space:]]*=[[:space:]]*(false|no|off|0)' \"$REPO/config.conf\"; then\n"
|
||||||
' AUTO_UPDATE="false"\n'
|
' AUTO_UPDATE="false"\n'
|
||||||
' fi\n'
|
' fi\n'
|
||||||
' fi\n'
|
' fi\n'
|
||||||
|
|||||||
Reference in New Issue
Block a user