Last active
December 2, 2023 15:58
-
-
Save mdesantis/ecc71e7e9bbf011ceb9711feea2e5b88 to your computer and use it in GitHub Desktop.
Revisions
-
mdesantis revised this gist
Dec 2, 2023 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,7 @@ set -o nounset # - cut # - tr nodejs_latest_lts_major=$( # Fetch Node.js versions metadata curl -fsSL https://nodejs.org/dist/index.json | \ # Reject items with falsey "lts" value | sort by "lts" | get the latest item's "version" value @@ -21,9 +21,9 @@ nodejs_lts_latest_version_major=$( tr -d 'v' ) echo "$nodejs_latest_lts_major" # Prints 20 (as at the time of writing the latest Node.js LTS is 20.x) # The value may be used to install the latest LTS version, e.g.: # curl -fsSL "https://deb.nodesource.com/setup_$nodejs_latest_lts_major.x" | sudo -E bash - # sudo apt-get install -y nodejs -
mdesantis revised this gist
Dec 2, 2023 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,7 +13,7 @@ set -o nounset nodejs_lts_latest_version_major=$( # Fetch Node.js versions metadata curl -fsSL https://nodejs.org/dist/index.json | \ # Reject items with falsey "lts" value | sort by "lts" | get the latest item's "version" value jq --raw-output 'map(select(.lts)) | sort_by(.lts) | .[-1].version' | \ # v20.10.0 => v20 cut -d '.' -f 1 | \ -
mdesantis revised this gist
Dec 2, 2023 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -23,7 +23,7 @@ nodejs_lts_latest_version_major=$( echo "$nodejs_lts_latest_version_major" # Prints 20 (as at the time of writing the latest Node.js LTS is 20.x) # The value may be used to install the latest LTS version, e.g.: # curl -fsSL "https://deb.nodesource.com/setup_$nodejs_lts_latest_version_major.x" | sudo -E bash - # sudo apt-get install -y nodejs -
mdesantis created this gist
Dec 2, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ #!/usr/bin/env bash set -o errexit set -o pipefail set -o nounset # Requirememnts: # - curl # - jq # - cut # - tr nodejs_lts_latest_version_major=$( # Fetch Node.js versions metadata curl -fsSL https://nodejs.org/dist/index.json | \ # Reject items with falsey "lts" value | sort by "lts" | get the latest item's version jq --raw-output 'map(select(.lts)) | sort_by(.lts) | .[-1].version' | \ # v20.10.0 => v20 cut -d '.' -f 1 | \ # v20 => 20 tr -d 'v' ) echo "$nodejs_lts_latest_version_major" # Prints 20 (as at the time of writing the latest Node.js LTS is 20.x) # The version may be used to install the latest LTS version, e.g.: # curl -fsSL "https://deb.nodesource.com/setup_$nodejs_lts_latest_version_major.x" | sudo -E bash - # sudo apt-get install -y nodejs