I just spend half an our figuring out how to check if a file exists on the remote machine,
File.exist? wont do the trick…
def file_exist?(path)
run "ls #{path}"
true
rescue Exception => e
false
end
I just spend half an our figuring out how to check if a file exists on the remote machine,
File.exist? wont do the trick…
def file_exist?(path)
run "ls #{path}"
true
rescue Exception => e
false
end
Where did you put that definition?
Ok, found it, so for other newbies: add the method in lib/capistrano/filecheck.rb and in Capfile: Dir.glob(‘lib/capistrano/*.rb’).each { |r| import r }, and if it’s Cap v3 change run to execute. Cheers!
Thx, update the code 🙂