File tree Expand file tree Collapse file tree 4 files changed +13
-4
lines changed
tools/office-cmdlet-updater Expand file tree Collapse file tree 4 files changed +13
-4
lines changed Original file line number Diff line number Diff line change
1
+ const { errorColor } = require ( '../helpers/colors' ) ;
2
+
1
3
class CliController {
2
4
constructor (
3
5
cliService ,
@@ -73,7 +75,7 @@ class CliController {
73
75
isNeedEmail
74
76
} )
75
77
. catch ( ( err ) => {
76
- console . error ( err ) ;
78
+ console . error ( errorColor ( err ) ) ;
77
79
78
80
this . powerShellService . dispose ( ) ;
79
81
} ) ;
Original file line number Diff line number Diff line change
1
+ const chalk = require ( 'chalk' ) ;
2
+
3
+ const errorColor = chalk . red . bgBlack ;
4
+
5
+ module . exports = {
6
+ errorColor
7
+ } ;
Original file line number Diff line number Diff line change 27
27
"await-of" : " ^1.1.2" ,
28
28
"awilix" : " ^3.0.9" ,
29
29
"better-queue" : " ^3.8.10" ,
30
+ "chalk" : " ^2.4.2" ,
30
31
"commander" : " ^2.19.0" ,
31
32
"config" : " ^2.0.1" ,
32
33
"fs-extra" : " ^7.0.0" ,
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ const Shell = require('node-powershell');
2
2
const of = require ( 'await-of' ) . default ;
3
3
const commands = require ( '../constants/commands' ) ;
4
4
const format = require ( 'string-format' ) ;
5
+ const { errorColor } = require ( '../helpers/colors' ) ;
5
6
6
7
class PowerShellService {
7
8
constructor ( config ) {
@@ -24,8 +25,6 @@ class PowerShellService {
24
25
const [ output , err ] = await of ( this . ps . invoke ( ) ) ;
25
26
26
27
if ( err ) {
27
- console . error ( err ) ;
28
-
29
28
throw new Error ( err ) ;
30
29
}
31
30
@@ -38,7 +37,7 @@ class PowerShellService {
38
37
const [ output , err ] = await of ( this . ps . invoke ( ) ) ;
39
38
40
39
if ( err && printError ) {
41
- console . error ( err ) ;
40
+ console . error ( errorColor ( err ) ) ;
42
41
}
43
42
44
43
return output ;
You can’t perform that action at this time.
0 commit comments