I've tried amending my code to the following:

  task :npm_install do
    on roles(:app) do
      within release_path + '/vendor/strangelove/cms' do
        puts capture(:pwd)
      end
    end
  end

but that fails with the following message:

DEBUG [b97cf958] Running /usr/bin/env if test ! -d /vendor/strangelove/cms; 
then echo "Directory does not exist '/vendor/strangelove/cms'" 1>&2; false; 
fi as deploy@<ip>
DEBUG [b97cf958] Command: if test ! -d /vendor/strangelove/cms; then echo 
"Directory does not exist '/vendor/strangelove/cms'" 1>&2; false; fi
DEBUG [b97cf958]        Directory does not exist '/vendor/strangelove/cms'
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as deploy@<ip>: if 
test ! -d /vendor/strangelove/cms; then echo "Directory does not exist 
'/vendor/strangelove/cms'" 1>&2; false; fi exit status: 1
if test ! -d /vendor/strangelove/cms; then echo "Directory does not exist 
'/vendor/strangelove/cms'" 1>&2; false; fi stdout: Nothing written
if test ! -d /vendor/strangelove/cms; then echo "Directory does not exist 
'/vendor/strangelove/cms'" 1>&2; false; fi stderr: Directory does not exist 
'/vendor/strangelove/cms'

SSHKit::Command::Failed: if test ! -d /vendor/strangelove/cms; then echo 
"Directory does not exist '/vendor/strangelove/cms'" 1>&2; false; fi exit 
status: 1
if test ! -d /vendor/strangelove/cms; then echo "Directory does not exist 
'/vendor/strangelove/cms'" 1>&2; false; fi stdout: Nothing written
if test ! -d /vendor/strangelove/cms; then echo "Directory does not exist 
'/vendor/strangelove/cms'" 1>&2; false; fi stderr: Directory does not exist 
'/vendor/strangelove/cms'

Tasks: TOP => odyssey:npm_install
(See full trace by running task with --trace)
The deploy has failed with an error: Exception while executing as 
deploy@<ip>: if test ! -d /vendor/strangelove/cms; then echo "Directory 
does not exist '/vendor/strangelove/cms'" 1>&2; false; fi exit status: 1
if test ! -d /vendor/strangelove/cms; then echo "Directory does not exist 
'/vendor/strangelove/cms'" 1>&2; false; fi stdout: Nothing written
if test ! -d /vendor/strangelove/cms; then echo "Directory does not exist 
'/vendor/strangelove/cms'" 1>&2; false; fi stderr: Directory does not exist 
'/vendor/strangelove/cms'

Which, in a way, is entirely accurate since that directory does not exist. 
For some reason the release_path is not being prepended.

If I change the code to

  task :npm_install do
    on roles(:app) do
      puts release_path
      puts release_path + '/vendor/strangelove/cms'
      within release_path.join('/vendor/strangelove/cms') do
        puts capture(:pwd)
      end
    end
  end

It does output the release path properly with the first puts statement, but 
the second one only has the `vendor/strangelove/cms` bit.

-- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/capistrano/6be7077a-cf19-4d7e-9942-349683236615%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to