diff --git a/run_once_20-install-user-packages.sh.tmpl b/run_once_20-install-user-packages.sh.tmpl index 1ceb58e..909ff2f 100755 --- a/run_once_20-install-user-packages.sh.tmpl +++ b/run_once_20-install-user-packages.sh.tmpl @@ -52,7 +52,14 @@ fi if command -v bun >/dev/null 2>&1; then if ! command -v omp >/dev/null 2>&1; then log "installing @oh-my-pi/pi-coding-agent via bun global" - bun add -g @oh-my-pi/pi-coding-agent 2>&1 | tail -10 + # Wrap in subshell so a segfault/timeout (e.g. Pi undervoltage + # killing the install mid-run, see pitfall #30) doesn't abort + # the whole bootstrap. omp can be retried manually later. + if (bun add -g @oh-my-pi/pi-coding-agent 2>&1 | tail -10); then + log "omp installed: $(omp --version 2>&1 | head -1)" + else + log "WARNING: bun add -g failed; omp not installed. Retry manually." + fi else log "omp already installed: $(omp --version 2>&1 | head -1)" fi @@ -114,7 +121,14 @@ fi if command -v bun >/dev/null 2>&1; then if ! command -v omp >/dev/null 2>&1; then log "installing @oh-my-pi/pi-coding-agent via bun global" - bun add -g @oh-my-pi/pi-coding-agent 2>&1 | tail -10 + # Wrap in subshell so a segfault/timeout (e.g. Pi undervoltage + # killing the install mid-run, see pitfall #30) doesn't abort + # the whole bootstrap. omp can be retried manually later. + if (bun add -g @oh-my-pi/pi-coding-agent 2>&1 | tail -10); then + log "omp installed: $(omp --version 2>&1 | head -1)" + else + log "WARNING: bun add -g failed; omp not installed. Retry manually." + fi else log "omp already installed: $(omp --version 2>&1 | head -1)" fi diff --git a/run_once_40-install-sway.sh.tmpl b/run_once_40-install-sway.sh.tmpl index 53e90b7..5225411 100644 --- a/run_once_40-install-sway.sh.tmpl +++ b/run_once_40-install-sway.sh.tmpl @@ -40,9 +40,18 @@ log "checking sway stack: ${SWAY_PKGS[*]}" # Only invoke sudo if any of the packages are missing. Bit has most # already; byte/kaiser are full. This avoids a no-op sudo prompt. +# +# Note: a few packages ship their CLI binary under a different name +# (e.g. wl-clipboard provides wl-copy/wl-paste, not `wl-clipboard`). +# Map those to the actual binary we use. +declare -A PKG_BIN=( + [wl-clipboard]="wl-copy" + [mako]="mako" +) MISSING_PKGS=() for p in "${SWAY_PKGS[@]}"; do - if ! command -v "$p" >/dev/null 2>&1; then + bin="${PKG_BIN[$p]:-$p}" + if ! command -v "$bin" >/dev/null 2>&1; then MISSING_PKGS+=("$p") fi done