mirror of
https://github.com/capistrano/capistrano
synced 2023-03-27 23:21:18 -04:00
ed0a3f08df
* #1736 Adds acceptance test for rollback feature. * Made vagrant_cli_command function return values explicitly over setting instance variables.
29 lines
533 B
Ruby
29 lines
533 B
Ruby
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)
|
|
%Q{[ -#{type} "#{path}" ]}
|
|
end
|
|
|
|
def symlinked?(symlink_path, target_path)
|
|
"[ #{symlink_path} -ef #{target_path} ]"
|
|
end
|
|
|
|
def safely_remove_file(_path)
|
|
run_vagrant_command("rm #{test_file}")
|
|
rescue
|
|
VagrantHelpers::VagrantSSHCommandError
|
|
end
|
|
end
|
|
|
|
World(RemoteCommandHelpers)
|