fix(@embark/console): ensure Cockpit is only started in non-secondary mode (#2026)

`embark console` registers and tries to spin up `Cockpit`, even when there's already
a Cockpit instance running and thefore exits with an error that a certain port is already
in use.

This commit ensures that Cockpit is only bootstrapped when `embark console` is
executed as a non-secondary process, meaning that there's no other `embark run`
process active that might occupy Cockpit's default port.
This commit is contained in:
Pascal Precht 2019-11-05 16:22:11 +01:00 committed by Iuri Matias
parent abe79c87f4
commit b0e71d9427
1 changed files with 3 additions and 1 deletions

View File

@ -380,7 +380,9 @@ class EmbarkController {
engine.registerModuleGroup("webserver"); engine.registerModuleGroup("webserver");
engine.registerModuleGroup("filewatcher"); engine.registerModuleGroup("filewatcher");
engine.registerModuleGroup("storage"); engine.registerModuleGroup("storage");
if (!isSecondaryProcess(engine)) {
engine.registerModuleGroup("cockpit"); engine.registerModuleGroup("cockpit");
}
engine.registerModulePackage('embark-deploy-tracker', {plugins: engine.plugins}); engine.registerModulePackage('embark-deploy-tracker', {plugins: engine.plugins});
callback(); callback();