srap/bin/run
2021-03-18 23:49:16 +01:00

25 lines
662 B
JavaScript
Executable file

#!/usr/bin/env node
"use strict";
// FIXME: Safe shutdown on ctrl+C
// FIXME: Somehow automatically detect whether other kernels are running on the system, and automatically clear locks when that is not the case?
const Promise = require("bluebird");
const yargs = require("yargs");
const path = require("path");
const createKernel = require("../src/kernel");
let argv = yargs.argv;
let configurationPath = argv._[0];
let absoluteConfigurationPath = path.join(process.cwd(), configurationPath);
let configuration = require(absoluteConfigurationPath);
return Promise.try(() => {
return createKernel(configuration);
}).then((kernel) => {
kernel.run();
});