diff --git a/home/.chezmoiscripts/universal/run_onchange_before_08-install-zx.tmpl b/home/.chezmoiscripts/universal/run_onchange_before_08-install-zx.tmpl index f1804451..d5959c6e 100644 --- a/home/.chezmoiscripts/universal/run_onchange_before_08-install-zx.tmpl +++ b/home/.chezmoiscripts/universal/run_onchange_before_08-install-zx.tmpl @@ -36,16 +36,21 @@ fi ### Setup Volta if command -v volta > /dev/null; then + ### Handle scenario where VOLTA_HOME is not defined yet if [ -z "$VOLTA_HOME" ]; then - volta setup - else logg warn 'VOLTA_HOME is not defined' + logg info 'Running `volta setup`' + volta setup fi + + ### Source .bashrc if [ -f "$HOME/.bashrc" ]; then . "$HOME/.bashrc" else logg warn 'Could not find `~/.bashrc` to source the results of `volta setup` from' fi + + ### Set PATH and install latest Node.js version via Volta export PATH="$VOLTA_HOME/bin:$PATH" logg 'Installing `node` via `volta`' volta install node@latest