@@ -31,19 +31,21 @@ export class NetSuiteSDF {
31
31
doSendPassword = true ;
32
32
doShowOutput = true ;
33
33
intervalId ;
34
+ outputChannel : vscode . OutputChannel ;
34
35
password : string ;
35
36
rootPath : string ;
36
37
savedStatus : string ;
37
38
sdfcli : Observable < string > ;
38
39
sdfConfig : SDFConfig ;
39
- sdfCliIsInstalled : boolean ;
40
+ sdfCliIsInstalled = true ; // Prevents error messages while Code is testing SDFCLI is installed.
40
41
statusBar : vscode . StatusBarItem ;
41
42
42
43
constructor ( private context : vscode . ExtensionContext ) {
43
44
this . checkSdfCliIsInstalled ( )
44
45
. then ( ( ) => {
45
46
if ( this . sdfCliIsInstalled ) {
46
47
this . initializeStatusBar ( ) ;
48
+ this . outputChannel = vscode . window . createOutputChannel ( 'SDF' ) ;
47
49
}
48
50
} ) ;
49
51
}
@@ -334,7 +336,7 @@ export class NetSuiteSDF {
334
336
return line ;
335
337
}
336
338
337
- async handleStdIn ( line : string , command : CLICommand , stdinSubject : Subject < string > , outputChannel : vscode . OutputChannel ) {
339
+ async handleStdIn ( line : string , command : CLICommand , stdinSubject : Subject < string > ) {
338
340
switch ( true ) {
339
341
case ( line . includes ( 'SuiteCloud Development Framework CLI' ) && this . doSendPassword ) :
340
342
stdinSubject . next ( `${ this . password } \n` ) ;
@@ -345,7 +347,7 @@ export class NetSuiteSDF {
345
347
if ( answer === 'Deploy' ) {
346
348
stdinSubject . next ( 'YES\n' ) ;
347
349
} else {
348
- outputChannel . append ( 'Cancelling deployment.\n' ) ;
350
+ this . outputChannel . append ( 'Cancelling deployment.\n' ) ;
349
351
stdinSubject . next ( 'NO\n' ) ;
350
352
}
351
353
break ;
@@ -396,10 +398,9 @@ export class NetSuiteSDF {
396
398
async runCommand ( command : CLICommand , ...args ) : Promise < any > {
397
399
await this . getConfig ( ) ;
398
400
if ( this . sdfConfig && this . activeEnvironment && this . password ) {
399
- const outputChannel = vscode . window . createOutputChannel ( 'SDF' ) ;
400
401
const workspaceFolders = vscode . workspace . workspaceFolders ;
401
402
if ( this . doShowOutput ) {
402
- outputChannel . show ( ) ;
403
+ this . outputChannel . show ( ) ;
403
404
}
404
405
405
406
const commandArray : [ CLICommand , string , string , string , string ] = [
@@ -426,8 +427,8 @@ export class NetSuiteSDF {
426
427
const collectedData = await this . sdfcli
427
428
. concatMap ( data => data . trim ( ) . split ( '\n' ) )
428
429
. map ( line => this . handlePassword ( line , command , stdinSubject ) )
429
- . do ( line => this . doShowOutput ? outputChannel . append ( `${ line } \n` ) : null )
430
- . do ( line => this . handleStdIn ( line , command , stdinSubject , outputChannel ) )
430
+ . do ( line => this . doShowOutput ? this . outputChannel . append ( `${ line } \n` ) : null )
431
+ . do ( line => this . handleStdIn ( line , command , stdinSubject ) )
431
432
. filter ( line => ! ( line . startsWith ( '[INFO]' ) || line . startsWith ( 'SuiteCloud Development Framework CLI' ) || line . startsWith ( 'SuiteCloud Development Framework CLI' ) || line . startsWith ( 'Done.' ) ) )
432
433
. map ( line => this . mapCommandOutput ( command , line ) )
433
434
. reduce ( ( acc : string [ ] , curr : string ) => acc . concat ( [ curr ] ) , [ ] )
0 commit comments