f
This commit is contained in:
@@ -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:
|
||||||
default_install = Path.cwd() / "Medios-Macina"
|
if is_in_repo:
|
||||||
print(f"\nNo repository found. Where should Medeos-Macina be installed?")
|
default_install = repo_root
|
||||||
|
else:
|
||||||
|
default_install = Path.cwd() / "Medios-Macina"
|
||||||
|
|
||||||
|
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,8 +971,9 @@ 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))
|
||||||
print(f"\nSuccessfully set up repository at {repo_root}")
|
if not args.quiet:
|
||||||
print("Resuming bootstrap...\n")
|
print(f"\nSuccessfully set up repository at {repo_root}")
|
||||||
|
print("Resuming bootstrap...\n")
|
||||||
|
|
||||||
# Re-initialize script_dir for the rest of the script
|
# Re-initialize script_dir for the rest of the script
|
||||||
# as if we started inside the repo scripts folder.
|
# as if we started inside the repo scripts folder.
|
||||||
|
|||||||
Reference in New Issue
Block a user