webogram-i2p/node_modules/.bin/karma
2014-01-05 20:07:11 +04:00

31 lines
731 B
JavaScript
Executable File

#!/usr/bin/env node
var path = require('path');
var fs = require('fs');
// Try to find a local install
var dir = path.resolve(process.cwd(), 'node_modules', 'karma', 'lib');
// Check if the local install exists else we use the install we are in
if (!fs.existsSync(dir)) {
dir = path.join('..', 'lib');
}
var cli = require(path.join(dir, 'cli'));
var config = cli.process();
switch (config.cmd) {
case 'start':
require(path.join(dir, 'server')).start(config);
break;
case 'run':
require(path.join(dir, 'runner')).run(config);
break;
case 'init':
require(path.join(dir, 'init')).init(config);
break;
case 'completion':
require(path.join(dir, 'completion')).completion(config);
break;
}