2013-12-02 23:27:25 +00:00
|
|
|
class Nvm < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Manage multiple Node.js versions"
|
2014-05-16 14:47:02 +00:00
|
|
|
homepage "https://github.com/creationix/nvm"
|
2015-08-24 20:56:12 +00:00
|
|
|
url "https://github.com/creationix/nvm/archive/v0.26.1.tar.gz"
|
|
|
|
sha256 "6add56210bd3a60517fea64eef11de01f5abfd5a23ca62c68ade9f115475b864"
|
2014-05-16 14:47:02 +00:00
|
|
|
head "https://github.com/creationix/nvm.git"
|
2013-12-02 23:27:25 +00:00
|
|
|
|
2015-08-14 05:29:50 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
2015-08-24 23:08:29 +00:00
|
|
|
sha256 "bda39c68500fdefd63389e2b496e41288a7d9a087f48de546f37ad7a122ba1a9" => :yosemite
|
|
|
|
sha256 "a28caf45d1b9f65bc73493562bf3eb7191fb8c4b54fcd75cf36692446245115f" => :mavericks
|
|
|
|
sha256 "262c46a1496abb2b060a46c19ce05eb36043e2c06c29e77f90c77d64639b2870" => :mountain_lion
|
2015-08-14 05:29:50 +00:00
|
|
|
end
|
|
|
|
|
2015-04-15 22:06:06 +00:00
|
|
|
resource "nvm-exec" do
|
2015-08-24 20:56:12 +00:00
|
|
|
url "https://raw.githubusercontent.com/creationix/nvm/v0.26.1/nvm-exec"
|
2015-05-04 00:04:27 +00:00
|
|
|
sha256 "a0581795f10114b9759992a82a43496daf4b4a52ad381a3072d8eee9866a28c5"
|
2015-08-24 20:56:12 +00:00
|
|
|
version "0.26.1"
|
2015-04-15 22:06:06 +00:00
|
|
|
end
|
|
|
|
|
2013-12-02 23:27:25 +00:00
|
|
|
def install
|
2014-05-16 14:47:02 +00:00
|
|
|
prefix.install "nvm.sh"
|
|
|
|
bash_completion.install "bash_completion" => "nvm"
|
2015-04-15 22:06:06 +00:00
|
|
|
|
|
|
|
resource("nvm-exec").stage do
|
|
|
|
prefix.install("nvm-exec")
|
|
|
|
chmod 0755, "#{prefix}/nvm-exec"
|
|
|
|
end
|
2013-12-02 23:27:25 +00:00
|
|
|
end
|
|
|
|
|
2014-05-16 14:47:02 +00:00
|
|
|
def caveats; <<-EOS.undent
|
2015-01-23 23:03:32 +00:00
|
|
|
Add NVM's working directory to your $HOME path (if it doesn't exist):
|
2013-12-02 23:27:25 +00:00
|
|
|
|
2015-01-23 23:03:32 +00:00
|
|
|
mkdir ~/.nvm
|
2013-12-02 23:27:25 +00:00
|
|
|
|
2015-04-15 22:06:06 +00:00
|
|
|
Copy nvm-exec to NVM's working directory
|
|
|
|
|
|
|
|
cp $(brew --prefix nvm)/nvm-exec ~/.nvm/
|
|
|
|
|
2015-01-23 23:03:32 +00:00
|
|
|
Add the following to $HOME/.bashrc, $HOME/.zshrc, or your shell's
|
|
|
|
equivalent configuration file:
|
2014-05-11 01:56:57 +00:00
|
|
|
|
|
|
|
export NVM_DIR=~/.nvm
|
2015-01-23 23:03:32 +00:00
|
|
|
source $(brew --prefix nvm)/nvm.sh
|
2015-01-14 04:15:51 +00:00
|
|
|
|
2013-12-02 23:27:25 +00:00
|
|
|
Type `nvm help` for further information.
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
end
|