From 3e942f9f3cad6d6cb8e1ced9c63b880d1bb96ad5 Mon Sep 17 00:00:00 2001 From: Marley Rae Date: Thu, 25 Jan 2024 14:27:41 -0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20nvm=20->=20Volta?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- javascript/install.sh | 9 +++++++++ node/install.sh | 15 --------------- node/node_utils.sh | 12 ++++++++++++ node/nvm.zsh | 4 ---- node/path.zsh | 3 +++ node/volta.sh | 13 +++++++++++++ node/volta.zsh | 3 +++ script/dot.sh | 2 ++ 8 files changed, 42 insertions(+), 19 deletions(-) create mode 100755 javascript/install.sh delete mode 100755 node/install.sh create mode 100644 node/node_utils.sh delete mode 100644 node/nvm.zsh create mode 100644 node/path.zsh create mode 100755 node/volta.sh create mode 100644 node/volta.zsh diff --git a/javascript/install.sh b/javascript/install.sh new file mode 100755 index 0000000..7f0b5eb --- /dev/null +++ b/javascript/install.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +# vim:set ft=bash: + +cd "$(dirname "${BASH_SOURCE[0]}")" \ + && source "../node/node_utils.sh" + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +npm_install "gulp-cli" "gulp CLI" diff --git a/node/install.sh b/node/install.sh deleted file mode 100755 index cae4463..0000000 --- a/node/install.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash -# vim:set ft=bash: - -cd "$(dirname "${BASH_SOURCE[0]}")" \ - && source "../script/utils.sh" - -if ! [[ -d "~/.zsh-plugins/zsh-nvm" ]]; then - execute \ - "git clone https://github.com/lukechilds/zsh-nvm.git ~/.zsh-plugins/zsh-nvm" \ - "zsh-nvm" -fi - -execute "nvm install lts/iron" "Node.js 20.x" - -execute "nvm install lts/hydrogen" "Node.js 18.x" diff --git a/node/node_utils.sh b/node/node_utils.sh new file mode 100644 index 0000000..eff57ff --- /dev/null +++ b/node/node_utils.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +# vim:set ft=bash: + +cd "$(dirname "${BASH_SOURCE[0]}")" \ + && source "../script/utils.sh" + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +npm_install() +{ + execute ". $DOT/node/path.zsh && npm install --global --silent $1" "$2" +} diff --git a/node/nvm.zsh b/node/nvm.zsh deleted file mode 100644 index 6f666d2..0000000 --- a/node/nvm.zsh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env zsh - -export NVM_COMPLETION=true -source ~/.zsh-plugins/zsh-nvm/zsh-nvm.plugin.zsh diff --git a/node/path.zsh b/node/path.zsh new file mode 100644 index 0000000..d5848fb --- /dev/null +++ b/node/path.zsh @@ -0,0 +1,3 @@ +#!/usr/bin/env zsh + +export PATH="$HOME/.volta/bin:$PATH" diff --git a/node/volta.sh b/node/volta.sh new file mode 100755 index 0000000..b2d20a4 --- /dev/null +++ b/node/volta.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +# vim:set ft=bash: + +cd "$(dirname "${BASH_SOURCE[0]}")" \ + && source "../script/utils.sh" + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +print_title "Volta & Node.js" + +execute "curl https://get.volta.sh | bash -s -- --skip-setup" "Volta" + +execute ". $DOT/node/path.zsh && volta install node" "Node.js LTS" diff --git a/node/volta.zsh b/node/volta.zsh new file mode 100644 index 0000000..dcaf12b --- /dev/null +++ b/node/volta.zsh @@ -0,0 +1,3 @@ +#!/usr/bin/env zsh + +export VOLTA_HOME="$HOME/.volta" diff --git a/script/dot.sh b/script/dot.sh index 14df995..11b0537 100755 --- a/script/dot.sh +++ b/script/dot.sh @@ -359,6 +359,8 @@ main() $dotfiles_dir/homebrew/brew.sh + $dotfiles_dir/node/volta.sh + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - print_title "Installers"