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 04:08:03 +00:00
|
|
|
var readline = require("readline");
|
2016-05-23 02:40:04 +00:00
|
|
|
var childProcess = require("child_process");
|
|
|
|
var earlyChild;
|
2016-06-10 03:18:03 +00:00
|
|
|
var doAnimation = true;
|
2016-06-10 03:36:06 +00:00
|
|
|
var doText = false;
|
|
|
|
if (process.argv.indexOf("-v") != -1 || process.env.CI) {
|
2016-06-10 03:18:03 +00:00
|
|
|
doAnimation = false;
|
|
|
|
}
|
2016-06-10 03:43:27 +00:00
|
|
|
else if (process.argv.indexOf("-v") == -1) {
|
2016-06-10 03:36:06 +00:00
|
|
|
doText = true;
|
|
|
|
}
|
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 = ""; }
|
2016-05-23 02:40:04 +00:00
|
|
|
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-06-10 03:36:06 +00:00
|
|
|
else if (doText) {
|
|
|
|
console.log("**** starting " + moduleNameArg.cyan + " ****");
|
|
|
|
}
|
2016-05-20 17:06:25 +00:00
|
|
|
};
|
|
|
|
exports.stop = function () {
|
2016-06-10 03:18:03 +00:00
|
|
|
if (doAnimation) {
|
|
|
|
earlyChild.kill();
|
2016-06-10 04:08:03 +00:00
|
|
|
var rl = readline.createInterface({
|
|
|
|
input: process.stdin,
|
|
|
|
output: process.stdout
|
|
|
|
});
|
|
|
|
rl.write(null, { ctrl: true, name: 'u' });
|
|
|
|
rl.close();
|
2016-06-10 03:18:03 +00:00
|
|
|
}
|
2016-05-20 17:06:25 +00:00
|
|
|
};
|
|
|
|
|
2016-06-10 04:08:03 +00:00
|
|
|
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxRQUFPLGdCQUNQLENBQUMsQ0FEc0I7QUFFdkIsSUFBTyxJQUFJLFdBQVcsTUFBTSxDQUFDLENBQUM7QUFDOUIsSUFBTyxRQUFRLFdBQVcsVUFBVSxDQUFDLENBQUM7QUFDdEMsSUFBTyxZQUFZLFdBQVcsZUFBZSxDQUFDLENBQUM7QUFDL0MsSUFBSSxVQUFVLENBQUM7QUFFZixJQUFJLFdBQVcsR0FBVyxJQUFJLENBQUM7QUFDL0IsSUFBSSxNQUFNLEdBQVcsS0FBSyxDQUFDO0FBQzNCLEVBQUUsQ0FBQSxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsQ0FBQyxJQUFJLE9BQU8sQ0FBQyxHQUFHLENBQUMsRUFBRSxDQUFDLENBQUEsQ0FBQztJQUNuRCxXQUFXLEdBQUcsS0FBSyxDQUFDO0FBQ3hCLENBQUM7QUFBQyxJQUFJLENBQUMsRUFBRSxDQUFBLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQSxDQUFDO0lBQ3hDLE1BQU0sR0FBRyxJQUFJLENBQUM7QUFDbEIsQ0FBQztBQUVELFVBQVU7QUFDQyxhQUFLLEdBQUcsVUFBUyxhQUF5QixFQUFDLGVBQTZCO0lBQXZELDZCQUF5QixHQUF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