Looking at the actual machine turned up something the shared plugin list could not express. The Mac loads macos, brew and dotbare; beastix and shron load archlinux. One list filtered by availability - which is what the stub did - would have dropped four plugins on the Mac without a word. Assembly moves into 05-pre-omz.zsh, which knows the role, and the availability filter stays on top of it so a plugin that is not installed still cannot produce a warning at every login. .zprofile is added, and that is the whole point of the mobile role. The Mac sets its PATH in .zshrc, so /opt/homebrew/bin exists for interactive shells and for nothing else: "ssh mac brew --version" comes back empty, which during the design phase was read as Homebrew not being installed. It is installed, with 178 formulae. Homebrew's shellenv belongs in .zprofile and now lives there; the loop is inert on Linux, where neither prefix exists. Carried over from the Mac: the Homebrew auto-update settings and bench(), which runs bench inside the ERPNext compose stack. PYTHONPATH pointed at /usr/lib/python3.9/site-packages there too - a Linux path on macOS, so doubly wrong. All three machines had a variant of that line and none of them is kept. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
31 lines
1.4 KiB
Bash
31 lines
1.4 KiB
Bash
# Role: mobile (the Mac - macOS on Apple Silicon)
|
|
#
|
|
# Homebrew's shellenv is NOT here. It belongs in .zprofile, which login shells
|
|
# read and .zshrc does not cover: a non-interactive "ssh mac <command>" sources
|
|
# neither .zshrc nor anything it pulls in, so a PATH set here leaves brew
|
|
# invisible. That is not theory - during the design phase "ssh mac brew
|
|
# --version" came back empty and was briefly taken as evidence that Homebrew
|
|
# was not installed at all. It was; the PATH just was not there.
|
|
|
|
# Role colour. Only takes effect where powerlevel10k is installed, which on
|
|
# this machine it is not yet - the ys theme has no equivalent. Kept so it
|
|
# applies the moment p10k arrives.
|
|
typeset -g POWERLEVEL9K_CONTEXT_BACKGROUND=green
|
|
|
|
# Homebrew's own behaviour. Auto-update on every invocation turns a one-second
|
|
# install into a minute.
|
|
export HOMEBREW_AUTO_UPDATE_SECS="86400"
|
|
export HOMEBREW_NO_AUTO_UPDATE="0"
|
|
|
|
# bench inside the ERPNext compose stack, without remembering where it lives.
|
|
# The -T is needed when there is no terminal, or docker compose refuses.
|
|
bench() {
|
|
local tty_flag=()
|
|
[[ -t 0 && -t 1 ]] || tty_flag=(-T)
|
|
docker compose --project-directory ~/work/erpnext exec "${tty_flag[@]}" backend bench "$@"
|
|
}
|
|
|
|
# The previous configuration exported PYTHONPATH=/usr/lib/python3.9/site-packages.
|
|
# That is a Linux path and does not exist on macOS at all; beastix and shron
|
|
# carried the same line pointing at 3.9 and 3.4 respectively. None are kept.
|