don't raise exception if file download fails

bug/bundler_fix
rwhitcroft 2015-04-10 16:23:33 -04:00
parent 284ef5bbbb
commit 64c2bf3227
1 changed files with 2 additions and 10 deletions

View File

@ -324,16 +324,8 @@ class Console::CommandDispatcher::Stdapi::Fs
meterp_temp.binmode
temp_path = meterp_temp.path
begin
# Download the remote file to the temporary file
client.fs.file.download_file(temp_path, args[0])
rescue RequestError => re
# If the file doesn't exist, then it's okay. Otherwise, throw the
# error.
if re.result != 2
raise $!
end
end
# Try to download the file, but don't worry if it doesn't exist
client.fs.file.download_file(temp_path, args[0]) rescue nil
# Spawn the editor (default to vi)
editor = Rex::Compat.getenv('EDITOR') || 'vi'