st-bundle
Version:
CLI for watching and bundling SpringType projects.
27 lines (26 loc) • 784 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const child_process_1 = require("child_process");
const exit_1 = require("../utils/exit");
class ElectronLauncher {
constructor(ctx, response, electronPath) {
this.ctx = ctx;
this.response = response;
this.electronPath = electronPath;
}
kill() {
if (this.node)
this.node.kill();
}
handleMainProcess() {
this.kill();
const firstBundle = this.response[0];
this.node = child_process_1.spawn(this.electronPath, [firstBundle.stat.absPath], {
stdio: 'inherit',
});
exit_1.onExit('ElectronLauncher', () => {
this.kill();
});
}
}
exports.ElectronLauncher = ElectronLauncher;