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"