From 0291d49dc1bcdf978a30aedb3caa1ab6ef3e1a21 Mon Sep 17 00:00:00 2001 From: Brian Zalewski Date: Thu, 16 Feb 2023 03:24:22 +0000 Subject: [PATCH] Update file run_onchange_before_08-install-zx.tmpl --- .../universal/run_onchange_before_08-install-zx.tmpl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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