From 17294cb5a79f3beb5ba3f6c9fb67d36f830d10ea Mon Sep 17 00:00:00 2001 From: Dominyk Tiller Date: Mon, 28 Sep 2015 02:12:50 +0100 Subject: [PATCH] nvm 0.27.1 Closes Homebrew/homebrew#43795. Closes Homebrew/homebrew#44394. Signed-off-by: Dominyk Tiller --- Formula/nvm.rb | 38 +++++++++++++++++--------------------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/Formula/nvm.rb b/Formula/nvm.rb index e166c4bcc6..1b2d987517 100644 --- a/Formula/nvm.rb +++ b/Formula/nvm.rb @@ -1,8 +1,8 @@ class Nvm < Formula desc "Manage multiple Node.js versions" homepage "https://github.com/creationix/nvm" - url "https://github.com/creationix/nvm/archive/v0.26.1.tar.gz" - sha256 "6add56210bd3a60517fea64eef11de01f5abfd5a23ca62c68ade9f115475b864" + url "https://github.com/creationix/nvm/archive/v0.27.1.tar.gz" + sha256 "74f843bf743017c086ea0c2549999afb0c81d8f5fa8bd2fdc92da37617e5b279" head "https://github.com/creationix/nvm.git" bottle do @@ -13,38 +13,34 @@ class Nvm < Formula sha256 "262c46a1496abb2b060a46c19ce05eb36043e2c06c29e77f90c77d64639b2870" => :mountain_lion end - resource "nvm-exec" do - url "https://raw.githubusercontent.com/creationix/nvm/v0.26.1/nvm-exec" - sha256 "a0581795f10114b9759992a82a43496daf4b4a52ad381a3072d8eee9866a28c5" - version "0.26.1" - end - def install - prefix.install "nvm.sh" + prefix.install "nvm.sh", "nvm-exec" bash_completion.install "bash_completion" => "nvm" - - resource("nvm-exec").stage do - prefix.install("nvm-exec") - chmod 0755, "#{prefix}/nvm-exec" - end end def caveats; <<-EOS.undent - Add NVM's working directory to your $HOME path (if it doesn't exist): + You should create NVM's working directory if it doesn't exist: mkdir ~/.nvm - Copy nvm-exec to NVM's working directory - - cp $(brew --prefix nvm)/nvm-exec ~/.nvm/ - - Add the following to $HOME/.bashrc, $HOME/.zshrc, or your shell's - equivalent configuration file: + Add the following to #{shell_profile} or your desired shell + configuration file: export NVM_DIR=~/.nvm source $(brew --prefix nvm)/nvm.sh + You can set $NVM_DIR to any location, but leaving it unchanged from + #{prefix} will destroy any nvm-installed Node installations + upon upgrade/reinstall. + Type `nvm help` for further information. EOS end + + test do + output = pipe_output("#{prefix}/nvm-exec 2>&1") + assert_no_match /No such file or directory/, output + assert_no_match /nvm: command not found/, output + assert_match /Node Version Manager/, output + end end