@@ -12,16 +12,16 @@ var DeployPluginBase = CoreObject.extend({
1212 this . context = context ;
1313 this . ui = context . ui ;
1414 this . project = context . project ;
15- context . config [ this . name ] = context . config [ this . name ] || { }
15+ context . config [ this . name ] = context . config [ this . name ] || { } ;
1616 this . pluginConfig = context . config [ this . name ] ;
1717 } ,
18- configure : function ( context ) {
19- this . log ( 'validating config' ) ;
18+ configure : function ( /* context */ ) {
19+ this . log ( 'validating config' , { verbose : true } ) ;
2020 var defaultProps = Object . keys ( this . defaultConfig || { } ) ;
2121 defaultProps . forEach ( this . applyDefaultConfigProperty . bind ( this ) ) ;
2222 var requiredProps = this . requiredConfig || [ ] ;
2323 requiredProps . forEach ( this . ensureConfigPropertySet . bind ( this ) ) ;
24- this . log ( 'config ok' ) ;
24+ this . log ( 'config ok' , { verbose : true } ) ;
2525 } ,
2626 applyDefaultConfigProperty : function ( propertyName ) {
2727 if ( this . pluginConfig [ propertyName ] === undefined ) {
@@ -31,7 +31,7 @@ var DeployPluginBase = CoreObject.extend({
3131 if ( typeof description === "function" ) {
3232 description = "[Function]" ;
3333 }
34- this . log ( 'Missing config: `' + propertyName + '`, using default: `' + description + '`' , { color : 'yellow' } ) ;
34+ this . log ( 'Missing config: `' + propertyName + '`, using default: `' + description + '`' , { color : 'yellow' , verbose : true } ) ;
3535 }
3636 } ,
3737 ensureConfigPropertySet : function ( propertyName ) {
@@ -49,12 +49,17 @@ var DeployPluginBase = CoreObject.extend({
4949 return configuredValue ;
5050 } ,
5151 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 ;
5455
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+ }
5863 }
5964} ) ;
6065
0 commit comments