mist
Version:
Mist build system
45 lines (37 loc) • 1.64 kB
JavaScript
#!/bin/sh
':' //; exec "$(command -v nodejs || command -v node)" "$0" "$@"
var argv, config, e, packageJson, path, prettyError, wrapAction,
indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
prettyError = require('../lib/pretty-error');
path = require('path');
config = require('commander');
packageJson = require('../package');
try {
(require('source-map-support')).install();
} catch (_error) {}
try {
wrapAction = function(name) {
return function() {
return (require(name)).apply(null, arguments);
};
};
config.cwd = process.cwd();
config.version(packageJson.version);
config.command('build').description('build the project').action(wrapAction('./mist-build'));
config.command('clean').description('clean the project of all outputs').action(wrapAction('./mist-clean'));
config.command('glob [globs...]').description('test file globbing patterns').action(wrapAction('./mist-glob'));
config.command('render').description('render Ninja configuration to a file').option('--out <file>', 'the filename of the rendered configuration', 'build.ninja').action(wrapAction('./mist-render'));
argv = process.argv;
if (!(2 in process.argv)) {
argv = process.argv.slice(0, 2).concat(['build']).concat(process.argv.slice(2));
} else if (!(process.argv[2] in config._events)) {
if (indexOf.call(process.argv, '--help') < 0) {
throw "unknown sub-command: " + process.argv[2];
}
}
config.parse(argv);
} catch (_error) {
e = _error;
prettyError(e);
}
//# sourceMappingURL=mist.js.map