bin/verb.js
function run(env) {
  console.log(); // empty line
  var verbfile = env.configPath;

  if (versionFlag && tasks.length === 0) {
    verbLog('CLI version', pkg.version);
    if (env.modulePackage && typeof env.modulePackage.version !== 'undefined') {
      verbLog('Local version', env.modulePackage.version);
    }
  }

  // `node_modules/verb`
  if (!env.modulePath || !fs.existsSync(env.modulePath)) {
    /* deps: verb */
    env.modulePath = resolve.sync('verb');
  }

  // chdir before requiring `verbfile.js` to allow users to chdir as needed
  if (process.cwd() !== env.cwd) {
    process.chdir(env.cwd);
    verbLog('working directory changed to', tildify(env.cwd));
  }

  // require verb
  var verbInst = require(env.modulePath);
  verbInst.extend('argv', argv);
  verbInst.emit('loaded');

  if (!argv._.length && argv.no) {
    exit(0);
  }

  // `verbfile.js`
  if ((hasVerbmd && !hasVerbfile) || !verbfile) {
    verbfile = resolve.sync('verb-default');
    env.configBase = path.dirname(env.configBase);
    require(verbfile)(verbInst);
  } else {
    // this is what actually loads up the verbfile
    require(verbfile);
  }

  verbLog('using verbfile', tildify(verbfile));
  logEvents(verbInst);

  process.nextTick(function () {
    if (simpleTasksFlag) {
      return logTasksSimple(env, verbInst);
    }
    if (tasksFlag) {
      return logTasks(env, verbInst);
    }

    verbInst.run(toRun, function (err) {
      if (err) console.error(err);
    });
  });
}
function run(env) {
  console.log(); // empty line
  var verbfile = env.configPath;

  if (versionFlag && tasks.length === 0) {
    verbLog('CLI version', pkg.version);
    if (env.modulePackage && typeof env.modulePackage.version !== 'undefined') {
      verbLog('Local version', env.modulePackage.version);
    }
  }

  // `node_modules/verb`
  if (!env.modulePath || !fs.existsSync(env.modulePath)) {
    /* deps: verb */
    env.modulePath = resolve.sync('verb');
  }

  // chdir before requiring `verbfile.js` to allow users to chdir as needed
  if (process.cwd() !== env.cwd) {
    process.chdir(env.cwd);
    verbLog('working directory changed to', tildify(env.cwd));
  }

  // require verb
  var verbInst = require(env.modulePath);
  verbInst.extend('argv', argv);
  verbInst.emit('loaded');

  if (!argv._.length && argv.no) {
    exit(0);
  }

  // `verbfile.js`
  if ((hasVerbmd && !hasVerbfile) || !verbfile) {
    verbfile = resolve.sync('verb-default');
    env.configBase = path.dirname(env.configBase);
    require(verbfile)(verbInst);
  } else {
    // this is what actually loads up the verbfile
    require(verbfile);
  }

  verbLog('using verbfile', tildify(verbfile));
  logEvents(verbInst);

  process.nextTick(function () {
    if (simpleTasksFlag) {
      return logTasksSimple(env, verbInst);
    }
    if (tasksFlag) {
      return logTasks(env, verbInst);
    }

    verbInst.run(toRun, function (err) {
      if (err) console.error(err);
    });
  });
}
function run ( env ) { console . log ( ) ; // empty line var verbfile = env . configPath ; if ( versionFlag && tasks . length === 0 ) { verbLog ( 'CLI version' , pkg . version ) ; if ( env . modulePackage && typeof env . modulePackage . version !== 'undefined' ) { verbLog ( 'Local version' , env . modulePackage . version ) ; } } // `node_modules/verb` if ( ! env . modulePath || ! fs . existsSync ( env . modulePath ) ) { /* deps: verb */ env . modulePath = resolve . sync ( 'verb' ) ; } // chdir before requiring `verbfile.js` to allow users to chdir as needed if ( process . cwd ( ) !== env . cwd ) { process . chdir ( env . cwd ) ; verbLog ( 'working directory changed to' , tildify ( env . cwd ) ) ; } // require verb var verbInst = require ( env . modulePath ) ; verbInst . extend ( 'argv' , argv ) ; verbInst . emit ( 'loaded' ) ; if ( ! argv . _ . length && argv . no ) { exit ( 0 ) ; } // `verbfile.js` if ( ( hasVerbmd && ! hasVerbfile ) || ! verbfile ) { verbfile = resolve . sync ( 'verb-default' ) ; env . configBase = path . dirname ( env . configBase ) ; require ( verbfile ) ( verbInst ) ; } else { // this is what actually loads up the verbfile require ( verbfile ) ; } verbLog ( 'using verbfile' , tildify ( verbfile ) ) ; logEvents ( verbInst ) ; process . nextTick ( function ( ) { if ( simpleTasksFlag ) { return logTasksSimple ( env , verbInst ) ; } if ( tasksFlag ) { return logTasks ( env , verbInst ) ; } verbInst . run ( toRun , function ( err ) { if ( err ) console . error ( err ) ; } ) ; } ) ; }
the actual logic
the actual logic