lib/config.js
function(config,callback,patsy){

      patsy     = typeof config === 'function' && typeof callback === 'object' ? callback : patsy;
      callback  = typeof config === 'function' ? config : callback;
      config    = typeof config === 'function' ? undefined : config;




      if(typeof config !== 'undefined' && typeof callback !== 'undefined' && typeof callback === 'function'){

        try{

          config = this.bake(config);

          fs.writeFileSync( "patsy.json", JSON.stringify( config, null, 2 ) );



          callback(patsy);

        } catch(e){

          console.log('config.create',e);

          return false;
        }

      } else {

          patsy.config.generateDefaultConfiguration();

          callback(patsy);

      }
    }
function(config,callback,patsy){

      patsy     = typeof config === 'function' && typeof callback === 'object' ? callback : patsy;
      callback  = typeof config === 'function' ? config : callback;
      config    = typeof config === 'function' ? undefined : config;




      if(typeof config !== 'undefined' && typeof callback !== 'undefined' && typeof callback === 'function'){

        try{

          config = this.bake(config);

          fs.writeFileSync( "patsy.json", JSON.stringify( config, null, 2 ) );



          callback(patsy);

        } catch(e){

          console.log('config.create',e);

          return false;
        }

      } else {

          patsy.config.generateDefaultConfiguration();

          callback(patsy);

      }
    }
function ( config , callback , patsy ) { patsy = typeof config === 'function' && typeof callback === 'object' ? callback : patsy ; callback = typeof config === 'function' ? config : callback ; config = typeof config === 'function' ? undefined : config ; if ( typeof config !== 'undefined' && typeof callback !== 'undefined' && typeof callback === 'function' ) { try { config = this . bake ( config ) ; fs . writeFileSync ( "patsy.json" , JSON . stringify ( config , null , 2 ) ) ; callback ( patsy ) ; } catch ( e ) { console . log ( 'config.create' , e ) ; return false ; } } else { patsy . config . generateDefaultConfiguration ( ) ; callback ( patsy ) ; } }
Function to create a config file with given configuration object

@param   Object    config
@param   Funciton  callback
Function to create a config file with given configuration object