Skip to content

Commit

Permalink
feat: ensure nvm with node version for fe
Browse files Browse the repository at this point in the history
  • Loading branch information
tanhongit committed Nov 5, 2024
1 parent 2afca54 commit 5225c96
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ INSTALLER=yarn
# E.g: prod, dev
ENV=prod

NODE_VERSION=22

USE_SUBMODULES=false
7 changes: 7 additions & 0 deletions setup/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ build_fe() {

home_resource_env

if ! command -v nvm &> /dev/null; then
# shellcheck disable=SC2155
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
fi
nvm use "$NODE_VERSION"

if ! command -v yarn &> /dev/null; then
echo ' ∟ Installing yarn...'
npm install -g yarn
Expand Down

0 comments on commit 5225c96

Please sign in to comment.