From 36091d458ba2d130a3e2c2132083173dcec7795e Mon Sep 17 00:00:00 2001 From: rain Date: Mon, 22 Jun 2026 15:19:11 -0400 Subject: [PATCH] Add user-local bin dirs to PATH in run_once_20 The script runs from a non-interactive context (chezmoi apply over SSH) where .zshrc isn't sourced. bun installs to ~/.bun/bin and omp/cargo to ~/.local/bin / ~/.cargo/bin, none of which are on the script's default PATH. Add them at the top so the post-install 'omp --version' and 'command -v omp' checks work. Fixes the spurious 'omp: command not found' right after a successful bun add -g on boxes where omp is freshly installed. --- run_once_20-install-user-packages.sh.tmpl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/run_once_20-install-user-packages.sh.tmpl b/run_once_20-install-user-packages.sh.tmpl index 909ff2f..f56b823 100755 --- a/run_once_20-install-user-packages.sh.tmpl +++ b/run_once_20-install-user-packages.sh.tmpl @@ -12,6 +12,12 @@ # ============================================================================= set -euo pipefail +# Make user-local bins (bun, omp, cargo) visible to the script even when +# invoked from a non-interactive context (e.g. `chezmoi apply` over SSH). +# These are normally added by .zshrc, but this script runs in a plain +# shell where those rc files aren't sourced. +export PATH="$HOME/.local/bin:$HOME/.bun/bin:$HOME/.cargo/bin:$PATH" + log() { printf '\033[1;34m[packages]\033[0m %s\n' "$*"; } die() { printf '\033[1;31m[packages ERROR]\033[0m %s\n' "$*" >&2; exit 1; }