File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ var colors = require('colours'),
1414 'build' : 'tmp/'
1515 } ;
1616
17- exports . jsonBuilder = function ( options ) {
17+ exports . jsonBuilder = function ( options , callback ) {
1818 lodash . merge ( opt , options ) ;
1919
2020 glob
@@ -37,7 +37,7 @@ exports.jsonBuilder = function (options) {
3737
3838 if ( ! fs . existsSync ( filePath ) ) {
3939 mkdirp ( filePath , function ( err ) {
40- if ( err ) {
40+ if ( ! lodash . isUndefined ( err ) ) {
4141 console . log ( err . red ) ;
4242 } else if ( opt . verbose ) {
4343 console . log ( opt . build . yellow , ' created.' ) ;
@@ -53,7 +53,7 @@ exports.jsonBuilder = function (options) {
5353 file = buildName + baseName + '-' + key + '.json' ;
5454
5555 fs . writeFile ( filePath + file , fileData , function ( err ) {
56- if ( err ) {
56+ if ( ! lodash . isUndefined ( err ) ) {
5757 console . log ( err . red ) ;
5858 } else if ( opt . verbose ) {
5959 console . log ( file . green , ' file was saved.' ) ;
@@ -62,4 +62,8 @@ exports.jsonBuilder = function (options) {
6262 } ) ;
6363
6464 } ) ;
65+
66+ if ( lodash . isFunction ( callback ) ) {
67+ callback ( ) ;
68+ }
6569} ;
You can’t perform that action at this time.
0 commit comments