bin/gen-edgerc.js
function init() {
  // Retrieve any arguments passed in via the command line
  args = cliConfig.getArguments();

  // Supply usage info if help argument was passed
  if (args.help) {
    console.log(cliConfig.getUsage());
    process.exit(0);
  }

  getClientAuth(function(data) {
    parseClientAuth(data, function(err, data) {
      if (err) {
        console.error(err.message);
        process.exit(0);
      }
      writeEdgerc(data, function(err) {
        if (err) {
          if (err.errno == -13) {
            console.error("Unable to access " + err.path + ". Please make sure you " +
              "have permission to access this file or perhaps try running the " +
              "command as sudo.");
            process.exit(0);
          }
        }
        console.log("The section '" + args.section + "' has been succesfully added to " + args.path + "\n");
      });
    });
  });
}
function init() {
  // Retrieve any arguments passed in via the command line
  args = cliConfig.getArguments();

  // Supply usage info if help argument was passed
  if (args.help) {
    console.log(cliConfig.getUsage());
    process.exit(0);
  }

  getClientAuth(function(data) {
    parseClientAuth(data, function(err, data) {
      if (err) {
        console.error(err.message);
        process.exit(0);
      }
      writeEdgerc(data, function(err) {
        if (err) {
          if (err.errno == -13) {
            console.error("Unable to access " + err.path + ". Please make sure you " +
              "have permission to access this file or perhaps try running the " +
              "command as sudo.");
            process.exit(0);
          }
        }
        console.log("The section '" + args.section + "' has been succesfully added to " + args.path + "\n");
      });
    });
  });
}
function init ( ) { // Retrieve any arguments passed in via the command line args = cliConfig . getArguments ( ) ; // Supply usage info if help argument was passed if ( args . help ) { console . log ( cliConfig . getUsage ( ) ) ; process . exit ( 0 ) ; } getClientAuth ( function ( data ) { parseClientAuth ( data , function ( err , data ) { if ( err ) { console . error ( err . message ) ; process . exit ( 0 ) ; } writeEdgerc ( data , function ( err ) { if ( err ) { if ( err . errno == - 13 ) { console . error ( "Unable to access " + err . path + ". Please make sure you " + "have permission to access this file or perhaps try running the " + "command as sudo." ) ; process . exit ( 0 ) ; } } console . log ( "The section '" + args . section + "' has been succesfully added to " + args . path + "\n" ) ; } ) ; } ) ; } ) ; }
Initialize the script, setting up default values, and prepping the
CLI params.
Initialize the script setting up default values and prepping the CLI params .