Merge pull request #8 from plutack/fix/nodenv

Dynamically get the latest LTS release version number
This commit is contained in:
David Heinemeier Hansson
2024-06-06 08:37:47 -07:00
committed by GitHub
2 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
if ! command -v nodenv &>/dev/null; then
# FIXME: Make this pick whatever the latest LTS is
DEFAULT_NODE_VERSION="20.13.1"
URL="https://nodejs.org/download/release/index.json"
DEFAULT_NODE_VERSION=$(curl -s "$URL" | jq -r '.[] | select(.lts != false) | .version' | head -n 1)
git clone https://github.com/nodenv/nodenv.git ~/.nodenv
sudo ln -vs ~/.nodenv/bin/nodenv /usr/local/bin/nodenv