From 748c51a687a1ec4b9462b2aa6e481509c0813231 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 24 May 2018 21:31:04 +0000 Subject: [PATCH] show selecting version in docs --- README.md | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 35325bb..fd3e175 100644 --- a/README.md +++ b/README.md @@ -36,13 +36,33 @@ wget -nv https://bit.ly/node-installer -O - ./node-installer.sh; bash ./node-ins ### Choosing a specific version ```bash -echo "Current node.js version is $(curl -fsSL https://nodejs.org/dist/index.tab | head -2 | tail -1 | cut -f 1)" +NODEJS_VER=$(curl -fsSL https://nodejs.org/dist/index.tab | tail -n +2 | cut -f 1 | head -1 ) +echo "The current node.js version is $NODEJS_VER" ``` ```bash -# To install a specific version rather than defaulting to latest -# latest version at time of writing are v8.11.1 and v10.1.0 -export NODEJS_VER="v10.1.0" +BASE_VER="v10\\." +NODEJS_VER=$(curl -fsSL https://nodejs.org/dist/index.tab | tail -n +2 | cut -f 1 | grep $BASE_VER | head -1 ) +echo "Latest node.js $BASE_VER is $NODEJS_VER" +``` + +To install the latest of a specific version rather than defaulting to latest + +```bash +### latest version +export NODEJS_VER="" + +# exact version +export NODEJS_VER="v10.2.1" + +# latest of v8.1.x +export NODEJS_VER="v8.1" + +# latest of v8.11.x +export NODEJS_VER="v8.11" + +# latest of v10.x +export NODEJS_VER="v10" ``` ### Choosing an install location @@ -101,7 +121,7 @@ wget -nv https://bit.ly/node-installer -O /tmp/node-installer.sh; bash /tmp/node ### Other things you should know -This is what gets installed: +This is what gets installed with the dev dependencies: * rsync * curl