diff options
| author | Mike McQuaid | 2014-10-27 15:42:28 +0000 |
|---|---|---|
| committer | Mike McQuaid | 2014-10-27 18:39:25 +0000 |
| commit | e2dc3592212c1d45def365cb7246c22e69413eb8 (patch) | |
| tree | 2534f30f8c20d77a4de7372e060bf008f15cd87b /Library/Formula | |
| parent | 1a806f42f62c3d4eb2bdb43e5612bf7ccae0b6cc (diff) | |
| download | homebrew-e2dc3592212c1d45def365cb7246c22e69413eb8.tar.bz2 | |
node: npm 2.1.6
Also: run `make install`, unlink any leftover manpages, set log level to
verbose, don't install the latest version of npm, don't link manpages
(as npm now does that itself).
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/node.rb | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/Library/Formula/node.rb b/Library/Formula/node.rb index de59f083a..7536719f5 100644 --- a/Library/Formula/node.rb +++ b/Library/Formula/node.rb @@ -33,10 +33,9 @@ class Node < Formula build 2326 end - # Bumping this may cause `brew test` to fail. resource "npm" do - url "https://registry.npmjs.org/npm/-/npm-1.4.28.tgz" - sha256 "df3c620cfe1664d45fb5f1948ca0ef1c8b3384acff31648557caac3a9ac2d459" + url "https://registry.npmjs.org/npm/-/npm-2.1.6.tgz" + sha1 "a28e8b44f910b9ab056aa0b73c13c1f9459c9b37" end def install @@ -53,28 +52,31 @@ class Node < Formula def post_install return if build.without? "npm" + (libexec/"npm").cd { system "make", "uninstall" } + Pathname.glob(HOMEBREW_PREFIX/"share/man/*") do |man| + next unless man.directory? + man.children.each do |file| + next unless file.symlink? + file.unlink if file.readlink.to_s.include? "/node_modules/npm/man/" + end + end + node_modules = HOMEBREW_PREFIX/"lib/node_modules" node_modules.mkpath cp_r libexec/"npm", node_modules npm_root = node_modules/"npm" npmrc = npm_root/"npmrc" - npmrc.atomic_write("prefix = #{HOMEBREW_PREFIX}\n") + npmrc.atomic_write <<-EOS.undent + prefix = #{HOMEBREW_PREFIX} + loglevel = verbose + EOS # make sure npm can find node ENV["PATH"] = "#{opt_bin}:#{ENV["PATH"]}" ENV["NPM_CONFIG_USERCONFIG"] = npmrc - npm_root.cd { system "make", "VERBOSE=1", "install" } - system "#{HOMEBREW_PREFIX}/bin/npm", "install", "--verbose", "--global", - "npm@latest", - "--prefix", HOMEBREW_PREFIX - - Pathname.glob(npm_root/"man/*") do |man| - man.children.each do |file| - ln_sf file, "#{HOMEBREW_PREFIX}/share/man/#{man.basename}" - end - end + npm_root.cd { system "make", "install" } if build.with? "completion" bash_completion.install_symlink \ |
