@@ -130,14 +130,9 @@ export class BundlePusher {
130
130
// Run 'npm install' for each package.json file that exists in the bundle
131
131
await this . runAllNpmInstalls ( sshSession , packageJsonFiles ) ;
132
132
133
- // Run DFHDPLOY to install the bundle
134
- const deployMessages = await this . deployBundle ( zosMFSession , bd , cicsSession , bundle ) ;
133
+ // Run DFHDPLOY to install the bundle (note that this will end the progress bar)
134
+ await this . deployBundle ( zosMFSession , bd , cicsSession , bundle ) ;
135
135
136
- // Complete the progress bar
137
- this . progressBar . percentComplete = TaskProgress . ONE_HUNDRED_PERCENT ;
138
- this . endProgressBar ( ) ;
139
-
140
- this . issueMessage ( deployMessages ) ;
141
136
return "PUSH operation completed" ;
142
137
}
143
138
@@ -205,13 +200,11 @@ export class BundlePusher {
205
200
}
206
201
207
202
private issueMessage ( msg : string ) {
208
- this . endProgressBar ( ) ;
209
203
this . params . response . console . log ( Buffer . from ( msg ) ) ;
210
204
if ( this . params . arguments . silent === undefined ) {
211
205
const logger = Logger . getAppLogger ( ) ;
212
206
logger . warn ( msg ) ;
213
207
}
214
- this . startProgressBar ( ) ;
215
208
}
216
209
217
210
private validateProfiles ( zosmfProfile : IProfile , sshProfile : IProfile , cicsProfile : IProfile ) {
@@ -345,7 +338,7 @@ export class BundlePusher {
345
338
}
346
339
347
340
private async deployBundle ( zosMFSession : AbstractSession , bd : BundleDeployer ,
348
- cicsSession : AbstractSession , bundle : Bundle ) : Promise < string > {
341
+ cicsSession : AbstractSession , bundle : Bundle ) {
349
342
// End the current progress bar so that DEPLOY can create its own
350
343
this . updateStatus ( "Deploying bundle '" + this . params . arguments . name + "' to CICS" ) ;
351
344
const subtask = new SubtaskWithStatus ( this . progressBar , TaskProgress . THIRTY_PERCENT ) ;
@@ -362,15 +355,15 @@ export class BundlePusher {
362
355
}
363
356
dfhdployOutput = bd . getJobOutput ( ) ;
364
357
365
- // Resume the current progress bar
358
+ // End the main progress bar
359
+ this . progressBar . percentComplete = TaskProgress . ONE_HUNDRED_PERCENT ;
366
360
this . endProgressBar ( ) ;
367
361
if ( deployError === undefined ) {
368
362
this . updateStatus ( "Deploy complete" ) ;
369
363
}
370
364
else {
371
365
this . updateStatus ( "Deploy ended with errors" ) ;
372
366
}
373
- this . startProgressBar ( ) ;
374
367
375
368
// Collect general information about the regions in the CICSplex scope
376
369
let deployMessages = await this . generateGeneralDiagnostics ( cicsSession ) ;
@@ -379,14 +372,13 @@ export class BundlePusher {
379
372
deployMessages += await this . generateNodejsSpecificDiagnostics ( cicsSession ) ;
380
373
}
381
374
375
+ // Report any console messages now
376
+ this . issueMessage ( deployMessages ) ;
377
+
382
378
// Now rethrow the original error, if there was one.
383
379
if ( deployError !== undefined ) {
384
- // If we're going to throw an error then report any messages now
385
- this . issueMessage ( deployMessages ) ;
386
380
throw deployError ;
387
381
}
388
-
389
- return deployMessages ;
390
382
}
391
383
392
384
private sshOutput ( data : string ) {
@@ -756,10 +748,10 @@ export class BundlePusher {
756
748
let stdout = outputRecord . stdout ;
757
749
let stderr = outputRecord . stderr ;
758
750
759
- if ( stdout === "" ) {
751
+ if ( stdout === undefined || stdout . trim ( ) === "" ) {
760
752
stdout = "<not available>" ;
761
753
}
762
- if ( stderr === "" ) {
754
+ if ( stderr === undefined || stderr . trim ( ) === "" ) {
763
755
stderr = "<not available>" ;
764
756
}
765
757
0 commit comments