UNPKG

979 BJavaScriptView Raw
1#!/usr/bin/env node
2"use strict";
3
4require("babel-core/register");
5require("babel-polyfill");
6var path = require('path');
7var fs = require('fs');
8
9global.enableExt = !(process.argv[2] == 'deploy' && process.argv[3] == 'box');
10global.enableExt = global.enableExt && !(process.argv[3] == 'deploy' && process.argv[4] == 'box');
11
12var homedir = require('os').homedir();
13var currentYargs = require('yargs') // eslint-disable-line
14.usage('Usage: $0 <cmd> [options]').option('storage-path', {
15 describe: 'path for persistent storage',
16 default: path.join(homedir, ".zeus")
17}).option('verbose', {
18 alias: 'v',
19 default: false
20}).commandDir('cmds').help('help').showHelpOnFail(false, 'whoops, something went wrong! run with --help').help('h').alias('h', 'help').demandCommand().completion().strict();
21
22var extPath = path.join(path.resolve('.'), 'extensions/commands');
23if (fs.existsSync(extPath) && global.enableExt) currentYargs = currentYargs.commandDir(extPath);
24
25currentYargs.argv;
\No newline at end of file