@@ -12,16 +12,16 @@ var DeployPluginBase = CoreObject.extend({
12
12
this . context = context ;
13
13
this . ui = context . ui ;
14
14
this . project = context . project ;
15
- context . config [ this . name ] = context . config [ this . name ] || { }
15
+ context . config [ this . name ] = context . config [ this . name ] || { } ;
16
16
this . pluginConfig = context . config [ this . name ] ;
17
17
} ,
18
- configure : function ( context ) {
19
- this . log ( 'validating config' ) ;
18
+ configure : function ( /* context */ ) {
19
+ this . log ( 'validating config' , { verbose : true } ) ;
20
20
var defaultProps = Object . keys ( this . defaultConfig || { } ) ;
21
21
defaultProps . forEach ( this . applyDefaultConfigProperty . bind ( this ) ) ;
22
22
var requiredProps = this . requiredConfig || [ ] ;
23
23
requiredProps . forEach ( this . ensureConfigPropertySet . bind ( this ) ) ;
24
- this . log ( 'config ok' ) ;
24
+ this . log ( 'config ok' , { verbose : true } ) ;
25
25
} ,
26
26
applyDefaultConfigProperty : function ( propertyName ) {
27
27
if ( this . pluginConfig [ propertyName ] === undefined ) {
@@ -31,7 +31,7 @@ var DeployPluginBase = CoreObject.extend({
31
31
if ( typeof description === "function" ) {
32
32
description = "[Function]" ;
33
33
}
34
- this . log ( 'Missing config: `' + propertyName + '`, using default: `' + description + '`' , { color : 'yellow' } ) ;
34
+ this . log ( 'Missing config: `' + propertyName + '`, using default: `' + description + '`' , { color : 'yellow' , verbose : true } ) ;
35
35
}
36
36
} ,
37
37
ensureConfigPropertySet : function ( propertyName ) {
@@ -49,12 +49,17 @@ var DeployPluginBase = CoreObject.extend({
49
49
return configuredValue ;
50
50
} ,
51
51
log : function ( message , opts ) {
52
- opts = opts || { color : 'blue' }
53
- opts [ 'color' ] = opts [ 'color' ] || 'blue' ;
52
+ opts = opts || { color : 'blue' } ;
53
+ opts . color = opts . color || 'blue' ;
54
+ var ui = this . ui ;
54
55
55
- this . ui . write ( blue ( '| ' ) ) ;
56
- var chalkColor = chalk [ opts . color ] ;
57
- this . ui . writeLine ( chalkColor ( '- ' + message ) ) ;
56
+ if ( ! opts . verbose || ( opts . verbose && ui . verbose ) ) {
57
+ if ( ui . verbose ) {
58
+ ui . write ( blue ( '| ' ) ) ;
59
+ }
60
+ var chalkColor = chalk [ opts . color ] ;
61
+ ui . writeLine ( chalkColor ( '- ' + message ) ) ;
62
+ }
58
63
}
59
64
} ) ;
60
65
0 commit comments