fix(fnm): load managed Node from always-on zsh layer

fnm lived in interactive-only ~/.config/zshrc, so ssh/agents/zsh -c
missed fnm-managed node. Source ~/.config/zsh/*.zsh from .zshenv and
install the fragment as zsh/fnm instead.
This commit is contained in:
Jeffrey
2026-08-07 14:08:07 +08:00
parent 7a43940317
commit 42c8305871
6 changed files with 104 additions and 30 deletions
+5 -3
View File
@@ -88,11 +88,13 @@ fi
# fnm use lts-latest
# fnm default lts-latest
# Apply the fnm zsh configuration patch (downloads zshrc/fnm.zsh to ~/.config/zshrc/fnm.zsh)
curl -fsSL https://git.miomio.moe/mio/easyzsh/raw/branch/master/patch.sh | bash -s -- fnm
# Always-on fragment: ~/.config/zsh/fnm.zsh (sourced from ~/.zshenv)
curl -fsSL https://git.miomio.moe/mio/easyzsh/raw/branch/master/patch.sh | bash -s -- zsh/fnm
# Drop legacy interactive-only copy if present
rm -f "${XDG_CONFIG_HOME:-$HOME/.config}/zshrc/fnm.zsh"
echo -e "\nfnm installation completed!"
echo -e "To start using fnm, restart your terminal or run: source ~/.zshrc"
echo -e "To start using fnm, restart your terminal or run: source ~/.zshenv"
echo -e "\nUseful fnm commands:"
echo -e " fnm install --lts # Install latest LTS Node.js"
echo -e " fnm use lts-latest # Use the latest LTS release"