From 5bd61720ca5e37db1edd0a6b66f568d9543d7f34 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sun, 14 Oct 2018 20:11:32 +0100 Subject: [PATCH] Add transparent lazy-loading of nvm --- files/zshrc/.zshrc | 1 - files/zshrc/javascript.sh | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/files/zshrc/.zshrc b/files/zshrc/.zshrc index 906b29c..5662390 100644 --- a/files/zshrc/.zshrc +++ b/files/zshrc/.zshrc @@ -36,5 +36,4 @@ alias src="source $HOME/.zshrc" {% if ansible_fqdn == "TOO-Work" %} pyenv-init - nvm-init {% endif %} diff --git a/files/zshrc/javascript.sh b/files/zshrc/javascript.sh index 4589fcc..3d134a5 100644 --- a/files/zshrc/javascript.sh +++ b/files/zshrc/javascript.sh @@ -34,9 +34,10 @@ nr() { alias nrc="npm run coverage" alias nrm="npm run mocha" -alias nvmu="nvm use" -nvm-init() { +nvm() { # This takes ~1sec, so we lazy-load it. + unset $0 source "/usr/share/nvm/init-nvm.sh" + $0 $@ }