Files
openfoodnetwork/script/nodenv-install.sh
David Cook 8f67e9839d Apply code suggestion
Avoids an error:
./script/nodenv-install.sh: line 13: brew: command not found

Co-authored-by: Maikel <maikel@email.org.au>
2023-03-10 13:38:59 +11:00

22 lines
555 B
Bash
Executable File

#!/bin/bash
#
# Install our selected Node version defined in the .node-version file.
#
# If our node-build version is outdated and it can't build the version we want
# then we try upgrading node-build and installing again.
if nodenv install --skip-existing; then
echo "Correct Node version is installed."
else
echo "Upgrading node-build:"
if command -v brew &> /dev/null; then
# Installation via Homebrew is recommended on macOS.
brew upgrade node-build
else
git -C "$(nodenv root)"/plugins/node-build pull
fi
nodenv install
fi