From fa795f6f0730569158c530774e4cba310b9dc6fc Mon Sep 17 00:00:00 2001 From: OCram85 Date: Wed, 19 Jul 2023 11:11:51 +0200 Subject: [PATCH] adds volta insall function. nodejs using volta --- arkanum | 32 ++++++++++++++++++++++++++++++-- arkanum-completion | 2 +- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/arkanum b/arkanum index 5563540..ff11b50 100755 --- a/arkanum +++ b/arkanum @@ -12,7 +12,8 @@ function showHelp() { dotnet Installs latest LTS dotnet core sdk + runtime. gitea Installs gitea tools like the changelog generator. golang Installs golang 1.19.3. - nodejs Installs latest NodeJs LTS version. + nodejs Installs latest NodeJs LTS version using Volta. + volta Installs Volta as NodeJS version manager. powershell Installs latest PowerShell LTS version. --disable-motd Disables hint in new bash terminal. --install-extensions Installs predefined recommended extensions. @@ -48,6 +49,14 @@ function sayE() { fi } +function sayW() { + if [[ -n "$2" ]]; then + echo -e "🧙 \e[33markanum\e[0m \e[34m[⚒️ $2]\e[0m: $1" 1>&2 + else + echo -e "🧙 \e[33markanum\e[0m: $1" 1>&2 + fi +} + function instDotNet() { say "Installing dotnet requirements..." "dotnet" sudo -E apt-get update > /dev/null @@ -107,6 +116,18 @@ function instNodeJs() { say "done." "NodeJs" } +function instNodeJS2() { + say "Installing NodeJS LTS via Volta..." "NodeJS" + volta install node@lts + say "done." "NodeJS" +} + +function instVolta() { + say "Installing Volta as NodeJS version manager..." "Volta" + curl -#fSl https://get.volta.sh | bash + say "done." "Volta" +} + function instPwsh() { say "Installing PowerShell requirements..." "PowerShell" sudo -E apt-get install --no-install-recommends -y \ @@ -211,7 +232,14 @@ function main() { elif [[ "$i" == "golang" ]]; then instGoLang elif [[ "$i" == "nodejs" ]]; then - instNodeJs + if [[ "$2" == "--legacy" ]]; then + sayW "Installing NodeJS with legacy function" "Arkanum" + instNodeJs + else + instNodeJS2 + fi + elif [[ "$i" == "volta" ]]; then + instVolta elif [[ "$i" == "powershell" ]]; then instPwsh elif [[ "$i" == "gitea" ]]; then diff --git a/arkanum-completion b/arkanum-completion index 248e6da..fda3dcb 100644 --- a/arkanum-completion +++ b/arkanum-completion @@ -1,3 +1,3 @@ #!/bin/bash -complete -W "--disable-motd --install-extensions --reset-codesetting dotnet gitea golang nodejs powershell -h" arkanum +complete -W "--disable-motd --install-extensions --reset-codesetting dotnet gitea golang nodejs volta powershell -h" arkanum