1 | #!/usr/bin/env node
|
2 | 'use strict';
|
3 |
|
4 | require('babel-core/register');
|
5 | require('babel-polyfill');
|
6 | var path = require('path');
|
7 | var fs = require('fs');
|
8 |
|
9 | global.enableExt = !(process.argv[2] == 'deploy' && process.argv[3] == 'box');
|
10 | global.enableExt = global.enableExt && !(process.argv[3] == 'deploy' && process.argv[4] == 'box');
|
11 |
|
12 | var homedir = require('os').homedir();
|
13 | var currentYargs = require('yargs')
|
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 |
|
22 | var extPath = path.join(path.resolve('.'), 'extensions/commands');
|
23 | if (fs.existsSync(extPath) && global.enableExt) {
|
24 | currentYargs = currentYargs.commandDir(extPath);
|
25 | }
|
26 |
|
27 | currentYargs.argv; |
\ | No newline at end of file |