Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

cleanup nave/npm support

  • Loading branch information...
commit 9920b6647547de1aef455bdf9678975e03fb37cc 1 parent 87b0e9a
@hollow hollow authored
Showing with 7 additions and 15 deletions.
  1. +5 −8 lib/capper/nave.rb
  2. +2 −7 lib/capper/npm.rb
View
13 lib/capper/nave.rb
@@ -15,21 +15,18 @@
task :setup do
nave_dir = fetch(:nave_dir, "~/.nave")
- run("mkdir -p #{nave_dir}")
- run("curl -s -L #{nave_installer_url} > #{nave_dir}/nave.sh; " +
- "chmod +x #{nave_dir}/nave.sh", :shell => "/bin/bash")
+ run("curl -s -L #{nave_installer_url} > #{bin_path}/nave; " +
+ "chmod +x #{bin_path}/nave", :shell => "/bin/bash")
install
end
desc <<-DESC
- Installs the specified node version uses the latest stable as default \
+ Installs the specified node version. (default: stable) \
- set :node_ver, "stable" # e.g. "0.8.1"
+ set :node_version, "stable" # e.g. "0.8.1"
DESC
task :install do
- node_ver = fetch(:node_ver, 'stable')
- node_install_cmd = fetch(:nave_dir, "~/.nave") + "/nave.sh install #{node_ver}"
- run node_install_cmd
+ run("#{bin_path}/nave install #{fetch(:node_version, 'stable')}"
end
end
View
9 lib/capper/npm.rb
@@ -16,13 +16,8 @@
set :npm_cmd, "npm" # e.g. "/usr/local/bin/npm"
DESC
task :install, :roles => :app, :except => { :no_release => true } do
- npm_cmd = fetch(:npm_cmd, "npm")
- app_path = fetch(:latest_release)
- if app_path.to_s.empty?
- raise error_type.new("Cannot detect current release path - make sure you have deployed at least once.")
- end
- prefix = fetch(:use_nave, false) ? "#{fetch(:nave_dir, "~/.nave")}/nave.sh use #{fetch(:node_ver, 'stable')}" :''
- run "cd #{app_path} && #{prefix} #{npm_cmd} install"
+ prefix = fetch(:use_nave, false) ? "#{bin_path}/nave use #{fetch(:node_version, 'stable')}" : ''
+ run("cd #{latest_release} && #{prefix} #{fetch(:npm_cmd, "npm")} install")
end
end

2 comments on commit 9920b66

@jormon

this breaks the nave/forever integration because forever references nave as nave.sh in node_dir where as you seem to be downloading nave into bin_path for reasons that are unclear. are you open to reverting to 1) going back to using nave.sh (the standard anyways?) and 2) leaving it nave_dir instead of bin_path?

@jormon

I think this is also what's breaking what I'm trying to fix in zenops/capper#7 because you're now trying to install nave into a directory that doesn't exist yet instead of ~/.nave or mkdir -ping that directory.

Please sign in to comment.
Something went wrong with that request. Please try again.