From a8c68517cf5593928fefbf5c5e5fcd1a2661744b Mon Sep 17 00:00:00 2001 From: Mourad De Clerck Date: Fri, 4 Dec 2020 17:06:56 +0100 Subject: [PATCH] Add basic support for nodenv See: https://github.com/nodenv/nodenv --- tasks/mina/nodenv.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tasks/mina/nodenv.rb diff --git a/tasks/mina/nodenv.rb b/tasks/mina/nodenv.rb new file mode 100644 index 00000000..6821dec1 --- /dev/null +++ b/tasks/mina/nodenv.rb @@ -0,0 +1,15 @@ +set :nodenv_path, "$HOME/.nodenv" + +task :'nodenv:load' do + comment %{Loading nodenv} + command %{export NODENV_ROOT="#{fetch(:nodenv_path)}"} + command %{export PATH="#{fetch(:nodenv_path)}/bin:$PATH"} + command %{ + if ! which nodenv >/dev/null; then + echo "! nodenv not found" + echo "! If nodenv is installed, check your :nodenv_path setting." + exit 1 + fi + } + command %{eval "$(nodenv init -)"} +end