UNPKG

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