Tell user to run `nvm use` in terminal if needed

Signed-off-by: Pedro Pombeiro <pombeirp@users.noreply.github.com>
This commit is contained in:
Pedro Pombeiro 2018-12-03 16:26:37 +01:00
parent 6c6d9bc268
commit 915ccbebbb
No known key found for this signature in database
GPG Key ID: A65DEB11E4BBC647
1 changed files with 10 additions and 1 deletions

View File

@ -25,7 +25,16 @@ fi
if ! program_exists node || ! program_exists yarn; then
echo -e "${YELLOW}********************************************************************************************"
echo -e "Please open another console to reload the environment, and then run make setup if necessary."
nvmrc="./.nvmrc"
if [ -e "$nvmrc" ]; then
node_version=$(node -v)
version_alias=$(cat "$nvmrc")
echo -e "Please run 'nvm use $version_alias' in the terminal and try again."
else
echo -e "Please open another console to reload the environment, and then run make setup if necessary."
fi
echo -e "********************************************************************************************${NC}"
exit 1
fi