diff --git a/.claude/memory/journal.md b/.claude/memory/journal.md index ce619ed..4f8f596 100644 --- a/.claude/memory/journal.md +++ b/.claude/memory/journal.md @@ -117,3 +117,6 @@ Done: window-style / window-active-style added. Two traps: colour234 ≈ iTerm2 ## 2026-10-07 (pm) — repo-sync: multi-forge repo tree Done: `bin/repo-sync` (gitlab/github/gitea/bitbucket cloud via curl+jq, daily cache, mkdir lock, dedup ns/project) + `repo` fn/completion in 3 rc files + install.sh jq + docs. Port of Alphalink dotfiles `repo`/`repo-reset`. Stub-curl harness caught token shift (IFS tab merges empty field); live GitLab 139 projects in 3s. Decided (chat): name `repo-sync`, tokens in `~/.config/repos/forges.conf` 0600, root `~/repos`, Bitbucket Cloud only. On feature/repo-sync, not finished. BDR/LRN offered, not written. + +## 2026-10-07 (2) — macOS zsh default, remote-install prompts +Done: choose_macos_shell default bash → zsh (Enter, no tty, unknown value). Found: `curl | bash` path never asked USER/EMAIL (stdin = pipe → `[ -t 0 ]` false → login name + empty email, bash, no offers); remote-install.sh now runs install.sh ` Piping a remote script into `bash` runs unreviewed code over the network. Read [`remote-install.sh`](remote-install.sh) first, or use the manual clone below. @@ -99,7 +99,7 @@ The script is re-runnable: each run re-backs up to `~/Oldconfig` (overwriting th ### macOS -The same `./install.sh` detects macOS and replaces `apt-get` with Homebrew. It first asks which login shell you want, **bash** or **zsh** (`[bash]` by default; answer in advance with `MACOS_SHELL=zsh ./install.sh`, and with no terminal attached it picks bash): +The same `./install.sh` detects macOS and replaces `apt-get` with Homebrew. It first asks which login shell you want, **zsh** or **bash** (`[zsh]` by default; answer in advance with `MACOS_SHELL=bash ./install.sh`, and with no terminal attached it picks zsh): 1. Installs Homebrew with its official script when `brew` is missing (this also pulls the Xcode Command Line Tools: clang, make, git), then `brew update` + `brew upgrade`. 2. Installs the apt list mapped to formulae: `vim git git-lfs git-filter-repo gitleaks pkgconf shellcheck gh git-delta curl gnupg lftp inetutils unzip tree tmux fzf dtach node python pipx php mariadb imagemagick ffmpeg weasyprint poppler qpdf webp libavif bash`. Brew's `php` already ships gd, mbstring, xml, intl, curl and mysql. diff --git a/install.sh b/install.sh index 03f13ec..2f7a357 100755 --- a/install.sh +++ b/install.sh @@ -345,18 +345,19 @@ install_colima_docker() { start_brew_service colima } -# macOS login shell: bash (brew's bash 5 + bashrc-osx) or zsh (oh-my-zsh + -# zshrc-osx). MACOS_SHELL=bash|zsh answers in advance; with no terminal attached -# and no answer, bash. Prints the choice on stdout (the question goes to stderr). +# macOS login shell: zsh (oh-my-zsh + zshrc-osx, the macOS default) or bash +# (brew's bash 5 + bashrc-osx). MACOS_SHELL=bash|zsh answers in advance; with no +# terminal attached and no answer, zsh. Prints the choice on stdout (the question +# goes to stderr). choose_macos_shell() { local answer="${MACOS_SHELL:-}" if [ -z "$answer" ] && [ -t 0 ]; then - read -rp "Login shell on macOS: bash or zsh (oh-my-zsh)? [bash] " answer || true + read -rp "Login shell on macOS: zsh (oh-my-zsh) or bash? [zsh] " answer || true fi case "$answer" in - zsh) echo zsh ;; - bash|"") echo bash ;; - *) echo "Unknown shell '$answer' — using bash" >&2; echo bash ;; + zsh|"") echo zsh ;; + bash) echo bash ;; + *) echo "Unknown shell '$answer' — using zsh" >&2; echo zsh ;; esac } diff --git a/remote-install.sh b/remote-install.sh index d83b79b..6041920 100755 --- a/remote-install.sh +++ b/remote-install.sh @@ -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/null; then + bash "$CLONE_DIR/install.sh"