Skip to content

Commit

Permalink
don't check for SSH private key in filesys until needed
Browse files Browse the repository at this point in the history
  • Loading branch information
aliasaria committed Jan 10, 2024
1 parent 121bdc0 commit b474bf3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/main/ssh-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ import * as shellCommands from './shell_commands/shellCommands';

const HOME_DIR = app.getPath('home');

const default_private_key = require('fs').readFileSync(
HOME_DIR + '/.ssh/id_rsa',
'utf8'
);
const default_private_key = '';
const default_private_key_location = HOME_DIR + '/.ssh/id_rsa';

var mainWindow = null;

Expand Down Expand Up @@ -40,7 +38,10 @@ ipcMain.handle('ssh:connect', (event, key) => {
if (sshkeylocation) {
var private_key = require('fs').readFileSync(sshkeylocation, 'utf8');
} else {
var private_key = default_private_key;
var private_key = require('fs').readFileSync(
default_private_key_location,
'utf8'
);
}

var result = '';
Expand Down

0 comments on commit b474bf3

Please sign in to comment.