2013-09-27 06:45:55 -04:00
|
|
|
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)
|
2014-04-22 11:36:44 -04:00
|
|
|
%{[ -#{type} "#{path}" ]}
|
2013-09-27 06:45:55 -04:00
|
|
|
end
|
2013-11-01 07:59:13 -04:00
|
|
|
|
2015-08-14 17:21:34 -04:00
|
|
|
def safely_remove_file(_path)
|
2014-04-22 11:36:44 -04:00
|
|
|
run_vagrant_command("rm #{test_file}") rescue VagrantHelpers::VagrantSSHCommandError
|
2013-11-01 07:59:13 -04:00
|
|
|
end
|
2013-09-27 06:45:55 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
World(RemoteCommandHelpers)
|