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

26 lines
441 B
Ruby
Raw Normal View History

module RemoteCommandHelpers
def test_dir_exists(path)
2016-02-28 18:16:11 -05:00
exists?("d", path)
end
def test_symlink_exists(path)
2016-02-28 18:16:11 -05:00
exists?("L", path)
end
def test_file_exists(path)
2016-02-28 18:16:11 -05:00
exists?("f", path)
end
def exists?(type, path)
%Q{[ -#{type} "#{path}" ]}
end
def safely_remove_file(_path)
2016-03-01 10:34:31 -05:00
run_vagrant_command("rm #{test_file}")
2016-03-01 10:55:23 -05:00
rescue VagrantHelpers::VagrantSSHCommandError
nil
end
end
World(RemoteCommandHelpers)