From e21a67d12ae0eb8dce4885dd14b579442358a281 Mon Sep 17 00:00:00 2001 From: Talut Salako <70220179+plutack@users.noreply.github.com> Date: Thu, 6 Jun 2024 00:09:03 +0000 Subject: [PATCH] auto grab latest lts version --- install/nodenv.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install/nodenv.sh b/install/nodenv.sh index 5e8bff0..f08fa15 100644 --- a/install/nodenv.sh +++ b/install/nodenv.sh @@ -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