feat(install): zsh is the default macOS shell; remote install keeps its prompts

- choose_macos_shell answers zsh on Enter, on no terminal and on an
  unknown value; MACOS_SHELL=bash still picks bash.
- remote-install.sh hands /dev/tty to install.sh when one can be opened:
  piped into bash, stdin was the script, so install.sh saw no terminal
  and silently skipped the identity, shell and offer questions.
- remote-install.sh cloned master by default; origin only has main
  (the documented raw URL 404s on master, 200 on main). README updated.
This commit is contained in:
@USER@
2026-10-07 15:42:34 +02:00
parent 2573756e73
commit cc490f57b3
4 changed files with 24 additions and 17 deletions
+10 -4
View File
@@ -1,14 +1,14 @@
#!/usr/bin/env bash
# remote-install.sh — one-liner bootstrap: clone this repo, then run install.sh.
# Usage:
# curl -fsSL https://git.bchanot.fr/bchanot/config/raw/branch/master/remote-install.sh | bash
# curl -fsSL https://git.bchanot.fr/bchanot/config/raw/branch/main/remote-install.sh | bash
# Override defaults with env vars:
# REPO_URL=... CLONE_DIR=... BRANCH=... curl ... | bash
set -euo pipefail
REPO_URL="${REPO_URL:-https://git.bchanot.fr/bchanot/config.git}"
CLONE_DIR="${CLONE_DIR:-$HOME/config}"
BRANCH="${BRANCH:-master}"
BRANCH="${BRANCH:-main}"
# git is required to fetch the repo. Install it on Debian/Ubuntu, else bail with a hint.
if ! command -v git >/dev/null 2>&1; then
@@ -36,6 +36,12 @@ else
git clone --quiet --branch "$BRANCH" "$REPO_URL" "$CLONE_DIR"
fi
# Hand off to the OS-detecting installer.
# Hand off to the OS-detecting installer. Piped into bash, stdin is the script
# itself, so install.sh would see no terminal and skip every question (identity,
# macOS shell, offers). Give it the terminal back when there is one.
echo "Running install.sh"
bash "$CLONE_DIR/install.sh"
if ( : </dev/tty ) 2>/dev/null; then
bash "$CLONE_DIR/install.sh" </dev/tty
else
bash "$CLONE_DIR/install.sh"
fi