fix: ~/.local/bin ahead of npm-global so the mmdc wrapper wins
npm's mmdc shadowed the ~/.local/bin wrapper that passes puppeteer the --no-sandbox config, so nvim's mermaid rendering failed on Ubuntu 24.04. No other ~/.local/bin wrapper shares a name with an npm-global binary. Brew still sits ahead of both: it has its own bat, herdr and python3.14, and moving it would change which of those runs.
This commit is contained in:
1 parent
e0c78a3ffa
commit
0a5ec74fa5
2 files changed
+4
-3
No files matched your search
@@ -5,8 +5,7 @@
|
||||
#
|
||||
# It execs the real mmdc found later on PATH (the npm-global install), skipping
|
||||
# itself. A bare `mmdc` reaches this wrapper only if ~/.local/bin comes before
|
||||
# the npm-global bin on PATH; where it does not, the real mmdc runs without the
|
||||
# sandbox args. (.zshrc currently prepends ~/.npm-global/bin last, so it wins.)
|
||||
# the npm-global bin on PATH, which is the order .zshrc sets.
|
||||
set -eu
|
||||
|
||||
self=$(cd "$(dirname "$0")" && pwd -P)/$(basename "$0")
|
||||
|
||||
+3
-1
@@ -68,8 +68,10 @@ _prepend() { [[ -d $1 ]] && path=("$1" $path) }
|
||||
_append() { [[ -d $1 ]] && path=($path "$1") }
|
||||
|
||||
_prepend "$HOME/bin"
|
||||
_prepend "$HOME/.local/bin"
|
||||
# ~/.local/bin after (so ahead of) npm-global: its wrappers -- mmdc with the
|
||||
# puppeteer --no-sandbox config -- must win over the npm binary they wrap.
|
||||
_prepend "$HOME/.npm-global/bin"
|
||||
_prepend "$HOME/.local/bin"
|
||||
_prepend "$HOME/code/speccy/bin"
|
||||
_append /usr/local/bin
|
||||
_append /usr/local/go/bin
|
||||
|
||||
Reference in new issue
Block a user