You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
709 B
JavaScript
32 lines
709 B
JavaScript
#!/usr/bin/env node
|
|
|
|
"use strict";
|
|
|
|
const Promise = require("bluebird");
|
|
const yargs = require("yargs");
|
|
const path = require("path");
|
|
|
|
const createKernel = require("../src/kernel");
|
|
const chalk = require("chalk");
|
|
|
|
let argv = yargs.argv;
|
|
let [ configurationPath, task, item ] = argv._;
|
|
let absoluteConfigurationPath = path.join(process.cwd(), configurationPath);
|
|
|
|
let configuration = require(absoluteConfigurationPath);
|
|
|
|
return Promise.try(() => {
|
|
return createKernel(configuration);
|
|
}).then((kernel) => {
|
|
return Promise.try(() => {
|
|
return kernel.simulate({
|
|
task: task,
|
|
itemID: item
|
|
});
|
|
}).then(() => {
|
|
console.log(chalk.green.bold("Done!"));
|
|
}).finally(() => {
|
|
kernel.shutdown();
|
|
});
|
|
});
|