f
This commit is contained in:
@@ -794,16 +794,25 @@ def main() -> int:
|
|||||||
"""Prompt for a clone location when running outside the repository."""
|
"""Prompt for a clone location when running outside the repository."""
|
||||||
nonlocal repo_root, script_dir, is_in_repo
|
nonlocal repo_root, script_dir, is_in_repo
|
||||||
|
|
||||||
|
# If script_path is None, we are running from a pipe/URL.
|
||||||
|
# In this mode, we ALWAYS want to ask for the directory,
|
||||||
|
# unless we have already asked and set is_in_repo to True within this session.
|
||||||
if is_in_repo and script_path is not None:
|
if is_in_repo and script_path is not None:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
# If we are in standalone mode and is_in_repo is True, it means we
|
||||||
|
# just finished cloning/setting up the path in the current execution.
|
||||||
|
# But we need to be careful: if we haven't asked yet, we must ask.
|
||||||
|
|
||||||
if not shutil.which("git"):
|
if not shutil.which("git"):
|
||||||
print("\nError: 'git' was not found on your PATH.", file=sys.stderr)
|
print("\nError: 'git' was not found on your PATH.", file=sys.stderr)
|
||||||
print("Please install Git (https://git-scm.com/) and try again.", file=sys.stderr)
|
print("Please install Git (https://git-scm.com/) and try again.", file=sys.stderr)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if is_in_repo and script_path is not None:
|
# When piped, script_path is None. We don't want to use the detected repo_root
|
||||||
|
# because that's just CWD.
|
||||||
|
if script_path is not None:
|
||||||
default_install = repo_root
|
default_install = repo_root
|
||||||
else:
|
else:
|
||||||
default_install = Path.cwd() / "Medios-Macina"
|
default_install = Path.cwd() / "Medios-Macina"
|
||||||
@@ -1003,13 +1012,18 @@ def main() -> int:
|
|||||||
if (sys.stdin.isatty() or sys.stdout.isatty() or script_path is None) and not args.quiet:
|
if (sys.stdin.isatty() or sys.stdout.isatty() or script_path is None) and not args.quiet:
|
||||||
sel = _interactive_menu()
|
sel = _interactive_menu()
|
||||||
if sel == "install":
|
if sel == "install":
|
||||||
# Force the prompt regardless of current environment detection
|
# Force set is_in_repo to False if piped to ensure _ensure_repo_available asks
|
||||||
|
if script_path is None:
|
||||||
|
is_in_repo = False
|
||||||
if not _ensure_repo_available():
|
if not _ensure_repo_available():
|
||||||
return 1
|
return 1
|
||||||
args.skip_deps = False
|
args.skip_deps = False
|
||||||
args.install_editable = True
|
args.install_editable = True
|
||||||
args.no_playwright = False
|
args.no_playwright = False
|
||||||
elif sel == "extras_hydrus":
|
elif sel == "extras_hydrus":
|
||||||
|
# Force set is_in_repo to False if piped to ensure _ensure_repo_available asks
|
||||||
|
if script_path is None:
|
||||||
|
is_in_repo = False
|
||||||
if not _ensure_repo_available():
|
if not _ensure_repo_available():
|
||||||
return 1
|
return 1
|
||||||
hydrus_script = repo_root / "scripts" / "hydrusnetwork.py"
|
hydrus_script = repo_root / "scripts" / "hydrusnetwork.py"
|
||||||
|
|||||||
Reference in New Issue
Block a user