bin/configure.js
function setup() {

    // check if config directory is given
    if( _config_path !== -1 ) {

      // get path
      var config_path = path.resolve( process.argv[ _config_path + 1 ] );

      // check if directory exists and is a valid directory
      fs.stat( config_path, function( err, stats ) {
        if( err && err.code === "ENOENT" ) {
          process.stdout.write( "The given directory doesn't exists.\n".red );
        } else if( err ) {

          // unknown error
          process.stdout.write( (err.message + "\n").red );
        } else if( !stats.isDirectory() ) {
          process.stdout.write( "The given config directory is not an actual directory.\n".red );
        } else {
          readConfigDir( config_path );
        }
      } );
      return;
    }

    // ask for config directory
    ask( "Where are your config files? ", function( c_path ) {
        readConfigDir( c_path );
    } );
}
function setup() {

    // check if config directory is given
    if( _config_path !== -1 ) {

      // get path
      var config_path = path.resolve( process.argv[ _config_path + 1 ] );

      // check if directory exists and is a valid directory
      fs.stat( config_path, function( err, stats ) {
        if( err && err.code === "ENOENT" ) {
          process.stdout.write( "The given directory doesn't exists.\n".red );
        } else if( err ) {

          // unknown error
          process.stdout.write( (err.message + "\n").red );
        } else if( !stats.isDirectory() ) {
          process.stdout.write( "The given config directory is not an actual directory.\n".red );
        } else {
          readConfigDir( config_path );
        }
      } );
      return;
    }

    // ask for config directory
    ask( "Where are your config files? ", function( c_path ) {
        readConfigDir( c_path );
    } );
}
function setup ( ) { // check if config directory is given if ( _config_path !== - 1 ) { // get path var config_path = path . resolve ( process . argv [ _config_path + 1 ] ) ; // check if directory exists and is a valid directory fs . stat ( config_path , function ( err , stats ) { if ( err && err . code === "ENOENT" ) { process . stdout . write ( "The given directory doesn't exists.\n" . red ) ; } else if ( err ) { // unknown error process . stdout . write ( ( err . message + "\n" ) . red ) ; } else if ( ! stats . isDirectory ( ) ) { process . stdout . write ( "The given config directory is not an actual directory.\n" . red ) ; } else { readConfigDir ( config_path ) ; } } ) ; return ; } // ask for config directory ask ( "Where are your config files? " , function ( c_path ) { readConfigDir ( c_path ) ; } ) ; }
Starts the config files setup process. It first asks for the configuration file directory. It then fetches for all
configuration files in the given directory and starts asking for the user values of each entry in each found file.
Starts the config files setup process . It first asks for the configuration file directory . It then fetches for all configuration files in the given directory and starts asking for the user values of each entry in each found file .