early/dist/index.js

37 lines
3.6 KiB
JavaScript
Raw Normal View History

2016-05-20 17:06:25 +00:00
"use strict";
2016-06-10 03:18:03 +00:00
require("typings-global");
2016-05-23 02:51:45 +00:00
var path = require("path");
2016-06-10 03:18:03 +00:00
var readline = require("readline");
var childProcess = require("child_process");
var earlyChild;
2016-06-10 03:18:03 +00:00
var doAnimation = true;
if (process.argv.indexOf("-v") != -1) {
doAnimation = false;
}
2016-05-21 18:33:13 +00:00
// exports
exports.start = function (moduleNameArg, loaderLengthArg) {
2016-05-21 22:38:14 +00:00
if (moduleNameArg === void 0) { moduleNameArg = ""; }
if (loaderLengthArg === void 0) { loaderLengthArg = "10"; }
2016-06-10 03:18:03 +00:00
if (doAnimation) {
earlyChild = childProcess.fork(path.join(__dirname, "early.child.js"), [], {
env: {
moduleNameArg: moduleNameArg,
loaderLengthArg: loaderLengthArg,
CI: process.env.CI
}
});
}
2016-05-20 17:06:25 +00:00
};
exports.stop = function () {
2016-06-10 03:18:03 +00:00
if (doAnimation) {
earlyChild.kill();
var rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
rl.close();
}
2016-05-20 17:06:25 +00:00
};
2016-06-10 03:18:03 +00:00
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxRQUFPLGdCQUNQLENBQUMsQ0FEc0I7QUFFdkIsSUFBTyxJQUFJLFdBQVcsTUFBTSxDQUFDLENBQUM7QUFDOUIsSUFBTyxRQUFRLFdBQVcsVUFBVSxDQUFDLENBQUM7QUFDdEMsSUFBTyxZQUFZLFdBQVcsZUFBZSxDQUFDLENBQUM7QUFDL0MsSUFBSSxVQUFVLENBQUM7QUFFZixJQUFJLFdBQVcsR0FBVyxJQUFJLENBQUM7QUFDL0IsRUFBRSxDQUFBLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUMs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