Commit 44ad1ce9 authored by David Nichols's avatar David Nichols
Browse files

refs #7 don't set keys that don't exist

parent 86f4556a
Pipeline #5529 passed with stage
in 6 minutes and 50 seconds
......@@ -218,7 +218,11 @@ private usageIntern(int offset = OffsetColumn) {
private string writeSftpFile(*string file_path) {
if (sftp_url) {
SFTPClient sftp(sftp_url);
sftp.setKeys(ENV.HOME + "/.ssh/id_rsa.old");
if (is_file(ENV.HOME + "/.ssh/id_rsa.old")) {
sftp.setKeys(ENV.HOME + "/.ssh/id_rsa.old");
} else if (is_file(ENV.HOME + "/.ssh/id_rsa")) {
sftp.setKeys(ENV.HOME + "/.ssh/id_rsa");
}
if (!file_path) {
file_path = sprintf("test-%s.txt", get_random_string());
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment