|
|
@@ -81,40 +81,46 @@ if (config.execCommandOnStartup) {
|
|
|
detached: config.execDetachedCommandOnStartup,
|
|
|
};
|
|
|
|
|
|
- if (global.settings.isDevMode) {
|
|
|
- options.onoutput = function (output) {
|
|
|
- const lastOutput = (core.startupCommandOutput.length > 1 ? core.startupCommandOutput[core.startupCommandOutput.length - 1] : null);
|
|
|
-
|
|
|
- if (lastOutput && lastOutput.source === output.source && lastOutput.content === output.content) {
|
|
|
- lastOutput.count++
|
|
|
- } else {
|
|
|
- if (core.startupCommandOutput.length >= constants.startupCommandConstants.outputLogLimit) {
|
|
|
- core.startupCommandOutput.shift();
|
|
|
- }
|
|
|
+ options.onoutput = function (output) {
|
|
|
+ if (!global.settings.isDevMode) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- core.startupCommandOutput.push({
|
|
|
- time: new Date(),
|
|
|
- type: 'output',
|
|
|
- source: output.source,
|
|
|
- content: output.content,
|
|
|
- count: output.count
|
|
|
- });
|
|
|
- }
|
|
|
- };
|
|
|
+ const lastOutput = (core.startupCommandOutput.length > 1 ? core.startupCommandOutput[core.startupCommandOutput.length - 1] : null);
|
|
|
|
|
|
- options.onerror = function (error) {
|
|
|
+ if (lastOutput && lastOutput.source === output.source && lastOutput.content === output.content) {
|
|
|
+ lastOutput.count++
|
|
|
+ } else {
|
|
|
if (core.startupCommandOutput.length >= constants.startupCommandConstants.outputLogLimit) {
|
|
|
core.startupCommandOutput.shift();
|
|
|
}
|
|
|
|
|
|
core.startupCommandOutput.push({
|
|
|
time: new Date(),
|
|
|
- type: 'error',
|
|
|
- source: error.type,
|
|
|
- content: error.error
|
|
|
+ type: 'output',
|
|
|
+ source: output.source,
|
|
|
+ content: output.content,
|
|
|
+ count: output.count
|
|
|
});
|
|
|
- };
|
|
|
- }
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ options.onerror = function (error) {
|
|
|
+ if (!global.settings.isDevMode) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (core.startupCommandOutput.length >= constants.startupCommandConstants.outputLogLimit) {
|
|
|
+ core.startupCommandOutput.shift();
|
|
|
+ }
|
|
|
+
|
|
|
+ core.startupCommandOutput.push({
|
|
|
+ time: new Date(),
|
|
|
+ type: 'error',
|
|
|
+ source: error.type,
|
|
|
+ content: error.error
|
|
|
+ });
|
|
|
+ };
|
|
|
|
|
|
process.execCommandAsync(options);
|
|
|
}
|
|
|
@@ -143,6 +149,11 @@ app.on('second-instance', (event, argv, workingDirectory, additionalData) => {
|
|
|
secondInstanceArgv = cmd.parseArguments(argv);
|
|
|
}
|
|
|
|
|
|
+ if (secondInstanceArgv && secondInstanceArgv.development) {
|
|
|
+ global.settings.isDevMode = !!secondInstanceArgv.development;
|
|
|
+ ipcRender.notifyRenderProcessChangeDevMode(!!secondInstanceArgv.development);
|
|
|
+ }
|
|
|
+
|
|
|
if (secondInstanceArgv && secondInstanceArgv.file && file.isContainsSupportedFileArg(secondInstanceArgv.file)) {
|
|
|
ipcRender.notifyRenderProcessNewNewTaskFromFileAfterViewLoaded(secondInstanceArgv.file);
|
|
|
ipcRender.notifyRenderProcessNavigateToNewTask();
|