From 486145fb70d89d2460061505e13408c7a80492c9 Mon Sep 17 00:00:00 2001 From: tavo Date: Sat, 18 Oct 2025 22:54:00 -0600 Subject: [PATCH] bupdate --- .gitignore | 1 + shell/profile.d/nvm.sh | 33 ++++++++++++++++++++++++++------- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 79dc7e9..72d8542 100644 --- a/.gitignore +++ b/.gitignore @@ -283,3 +283,4 @@ sunshine/ clipse/ X11/xinit/xinitrc.d/* github-copilot +configstore/ diff --git a/shell/profile.d/nvm.sh b/shell/profile.d/nvm.sh index e552142..f5c2215 100644 --- a/shell/profile.d/nvm.sh +++ b/shell/profile.d/nvm.sh @@ -2,11 +2,30 @@ export NVM_DIR="$HOME/.config/nvm" -if [ -s "$NVM_DIR/nvm.sh" ]; then - # nvm.sh is a very large file that causes shell startup to slow - # down, this wrapper sources nvm.sh only after calling nvm. - nvm() { +_nvm_lazy_load() { + unset -f nvm npm npx node + + if [ -s "$NVM_DIR/nvm.sh" ]; then . "$NVM_DIR/nvm.sh" - nvm "$@" - } -fi + fi +} + +nvm() { + _nvm_lazy_load + nvm $@ +} + +npm() { + _nvm_lazy_load + npm $@ +} + +npx() { + _nvm_lazy_load + npx $@ +} + +node() { + _nvm_lazy_load + node $@ +}