Prefer getFlagBoolean over getFlag

pull/285/head
Kelvin Schoofs 3 years ago
parent 3109e977a5
commit 06bce853af

@ -4,7 +4,7 @@ import { userInfo } from 'os';
import { Client, ClientChannel, ConnectConfig, SFTPWrapper as SFTPWrapperReal } from 'ssh2'; import { Client, ClientChannel, ConnectConfig, SFTPWrapper as SFTPWrapperReal } from 'ssh2';
import { SFTPStream } from 'ssh2-streams'; import { SFTPStream } from 'ssh2-streams';
import * as vscode from 'vscode'; import * as vscode from 'vscode';
import { getConfig, getFlag, getFlagBoolean } from './config'; import { getConfig, getFlagBoolean } from './config';
import type { FileSystemConfig } from './fileSystemConfig'; import type { FileSystemConfig } from './fileSystemConfig';
import { censorConfig, Logging } from './logging'; import { censorConfig, Logging } from './logging';
import type { PuttySession } from './putty'; import type { PuttySession } from './putty';
@ -257,7 +257,7 @@ export async function createSSH(config: FileSystemConfig, sock?: NodeJS.Readable
}); });
try { try {
const finalConfig: ConnectConfig = { ...config, sock, ...DEFAULT_CONFIG }; const finalConfig: ConnectConfig = { ...config, sock, ...DEFAULT_CONFIG };
if (config.debug || getFlag('DEBUG_SSH2', config.flags) !== undefined) { if (config.debug || getFlagBoolean('DEBUG_SSH2', false, config.flags)[0]) {
const scope = Logging.scope(`ssh2(${config.name})`); const scope = Logging.scope(`ssh2(${config.name})`);
finalConfig.debug = (msg: string) => scope.debug(msg); finalConfig.debug = (msg: string) => scope.debug(msg);
} }

Loading…
Cancel
Save