This commit is contained in:
2026-01-21 23:09:12 -08:00
parent c0aab8e2f9
commit d1ec5807e2

View File

@@ -928,15 +928,20 @@ def main() -> int:
if (sys.stdin.isatty() or sys.stdout.isatty()) and not args.quiet: if (sys.stdin.isatty() or sys.stdout.isatty()) and not args.quiet:
sel = _interactive_menu() sel = _interactive_menu()
if sel == "install": if sel == "install":
if not is_in_repo: # If running via pipe/standalone or not in a repo, ask for installation path
if not is_in_repo or script_path is None:
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 1 return 1
try: try:
if is_in_repo:
default_install = repo_root
else:
default_install = Path.cwd() / "Medios-Macina" default_install = Path.cwd() / "Medios-Macina"
print(f"\nNo repository found. Where should Medeos-Macina be installed?")
print(f"\nWhere would you like to install Medeos-Macina?")
install_dir_raw = input(f"Installation directory [{default_install}]: ").strip() install_dir_raw = input(f"Installation directory [{default_install}]: ").strip()
if not install_dir_raw: if not install_dir_raw:
install_path = default_install install_path = default_install
@@ -951,7 +956,8 @@ def main() -> int:
# Check if it already has a repo (user might have chosen an existing folder) # Check if it already has a repo (user might have chosen an existing folder)
if _is_valid_mm_repo(install_path): if _is_valid_mm_repo(install_path):
print(f"Found existing repository in {install_path}.") if not args.quiet:
print(f"Using existing repository in {install_path}.")
repo_root = install_path repo_root = install_path
else: else:
print(f"Cloning Medeos-Macina into {install_path} (depth 1)...") print(f"Cloning Medeos-Macina into {install_path} (depth 1)...")
@@ -965,6 +971,7 @@ def main() -> int:
# Change directory to the newly established repo root # Change directory to the newly established repo root
os.chdir(str(repo_root)) os.chdir(str(repo_root))
if not args.quiet:
print(f"\nSuccessfully set up repository at {repo_root}") print(f"\nSuccessfully set up repository at {repo_root}")
print("Resuming bootstrap...\n") print("Resuming bootstrap...\n")