Fix bug with usernamefromenvironment for PuTTY session (issue #71)

pull/84/head
Kelvin Schoofs 6 years ago
parent ee0041402e
commit 037eeb5359

@ -53,8 +53,8 @@ export async function calculateActualConfig(config: FileSystemConfig): Promise<F
config.port = session.portnumber || config.port; config.port = session.portnumber || config.port;
config.agent = config.agent || (session.tryagent ? 'pageant' : undefined); config.agent = config.agent || (session.tryagent ? 'pageant' : undefined);
if (session.usernamefromenvironment) { if (session.usernamefromenvironment) {
config.username = process.env.USERNAME; config.username = process.env.USERNAME || process.env.USER;
if (!config.username) throw new Error(`Trying to use the system username, but process.env.USERNAME is missing`); if (!config.username) throw new Error(`Trying to use the system username, but process.env.USERNAME or process.env.USER is missing`);
} }
config.privateKeyPath = config.privateKeyPath || (!config.agent && session.publickeyfile) || undefined; config.privateKeyPath = config.privateKeyPath || (!config.agent && session.publickeyfile) || undefined;
switch (session.proxymethod) { switch (session.proxymethod) {

Loading…
Cancel
Save