cli.js 526 Bytes
const yargs = require('yargs');

require('./config-yargs')(yargs);



const cmdStatic = yargs.argv._.some(c => c === 'static');
const cmdUpload = yargs.argv._.some(c => c === 'upload');

try {
  if (cmdStatic) {
    require('./static')({
      code_path: yargs.argv.open,
      env: yargs.argv.production ? 'production' : 'dev'
    });
  } else if (cmdUpload) {
    require('./upload')({
      code_path: yargs.argv.path,
      ver: yargs.argv.ver,
      desc: yargs.argv.desc
    });
  }

} catch (e) {
  console.error(e);
}