1
0
Fork 0
mirror of https://github.com/capistrano/capistrano synced 2023-03-27 23:21:18 -04:00
capistrano/features/support/remote_command_helpers.rb

25 lines
488 B
Ruby
Raw Normal View History

module RemoteCommandHelpers
def test_dir_exists(path)
exists?('d', path)
end
def test_symlink_exists(path)
exists?('L', path)
end
def test_file_exists(path)
exists?('f', path)
end
def exists?(type, path)
%{[ -#{type} "#{path}" ] && echo "#{path} exists." || echo "Error: #{path} does not exist."}
end
def safely_remove_file(path)
run_vagrant_command("rm #{test_file}") rescue Vagrant::Errors::VagrantError
end
end
World(RemoteCommandHelpers)