From 99b10211dabcfce5cee0436d55fcc94423b54207 Mon Sep 17 00:00:00 2001 From: Akos Kitta Date: Tue, 15 Aug 2023 15:14:39 +0200 Subject: [PATCH] fix: do not merge in app+CLI versions in dev mode when running in dev mode, the backend application is not bundled. hence, the FS paths of the source `package.json`s are different. --- .../src/electron-main/theia/electron-main-application.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arduino-ide-extension/src/electron-main/theia/electron-main-application.ts b/arduino-ide-extension/src/electron-main/theia/electron-main-application.ts index 76ee458be..9cb5f74e4 100644 --- a/arduino-ide-extension/src/electron-main/theia/electron-main-application.ts +++ b/arduino-ide-extension/src/electron-main/theia/electron-main-application.ts @@ -13,6 +13,7 @@ import { promises as fs, rm, rmSync } from 'node:fs'; import type { MaybePromise, Mutable } from '@theia/core/lib/common/types'; import { ElectronSecurityToken } from '@theia/core/lib/electron-common/electron-token'; import { FrontendApplicationConfig } from '@theia/application-package/lib/application-props'; +import { environment } from '@theia/application-package/lib/environment'; import { ElectronMainApplication as TheiaElectronMainApplication, ElectronMainExecutionParams, @@ -702,6 +703,12 @@ class InterruptWorkspaceRestoreError extends Error { async function updateFrontendApplicationConfigFromPackageJson( config: FrontendApplicationConfig ): Promise { + if (environment.electron.isDevMode()) { + console.debug( + 'Skipping frontend application configuration customizations. Running in dev mode.' + ); + return config; + } try { const modulePath = __filename; // must go from `./lib/backend/electron-main.js` to `./package.json` when the app is webpacked.