From 71b8207a59daabf4dad48777bcdeaaf57d354619 Mon Sep 17 00:00:00 2001 From: Nikolay Frolov <90333448+nikolai-frolov@users.noreply.github.com> Date: Thu, 11 Nov 2021 12:47:29 +0300 Subject: [PATCH] [Ubuntu] Change source of n tool to official (#4455) --- .../scripts/SoftwareReport/SoftwareReport.Generator.ps1 | 1 + .../linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1 | 5 +++++ images/linux/scripts/installers/nodejs.sh | 5 ++--- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 b/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 index c11f0031c..9c6c32dd4 100644 --- a/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 +++ b/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 @@ -126,6 +126,7 @@ $toolsList = @( (Get-HGVersion), (Get-MinikubeVersion), (Get-NewmanVersion), + (Get-NVersion), (Get-NvmVersion), (Get-OpensslVersion), (Get-PackerVersion), diff --git a/images/linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1 b/images/linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1 index e4d65b090..45eaa41ff 100644 --- a/images/linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1 +++ b/images/linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1 @@ -170,6 +170,11 @@ function Get-NewmanVersion { return "Newman $(newman --version)" } +function Get-NVersion { + $nVersion = (n --version).Replace('v', '') + return "n $nVersion" +} + function Get-NvmVersion { $nvmVersion = bash -c "source /etc/skel/.nvm/nvm.sh && nvm --version" return "nvm $nvmVersion" diff --git a/images/linux/scripts/installers/nodejs.sh b/images/linux/scripts/installers/nodejs.sh index bbf89a67a..3969e3899 100644 --- a/images/linux/scripts/installers/nodejs.sh +++ b/images/linux/scripts/installers/nodejs.sh @@ -9,9 +9,8 @@ source $HELPER_SCRIPTS/install.sh # Install default Node.js defaultVersion=$(get_toolset_value '.node.default') -# TODO: Usage of "githubusercontent.com/mklement0" doesn't look like a correct approach. Need to correct it according to the official Node.js docs. -curl -sL https://raw.githubusercontent.com/mklement0/n-install/stable/bin/n-install | bash -s -- -ny - -~/n/bin/n $defaultVersion +curl -L https://raw.githubusercontent.com/tj/n/master/bin/n -o ~/n +bash ~/n $defaultVersion # Install node modules node_modules=$(get_toolset_value '.node_modules[].name')