Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: safer electron version parsing for electron-builder command #2671

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,9 @@ import('@theia/core/lib/browser/common-frontend-contribution.js').then(
theiaCommonContribution['supportPaste'] = true;
}
);

export default new ContainerModule((bind, unbind, isBound, rebind) => {
console.log('Triggering full build');

// Commands, colors, theme adjustments, and toolbar items
bind(ArduinoFrontendContribution).toSelf().inSingletonScope();
bind(CommandContribution).toService(ArduinoFrontendContribution);
Expand Down
14 changes: 12 additions & 2 deletions electron-app/scripts/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ async function run() {
/** @type {string} */
const electronVersion =
require('../package.json').devDependencies['electron'];
const cleanElectronVersion = semver.clean(electronVersion.replace(/^\^/, ''));
if (!cleanElectronVersion) {
throw new Error(
`Electron semver validation failed for version: '${electronVersion}'.`
);
}
const platform = electronPlatform();
const version = await getVersion();
/** @type {string|unknown} */
Expand All @@ -18,7 +24,7 @@ async function run() {
'--publish',
'never',
'-c.electronVersion',
semver.clean(electronVersion.replace(/^\^/, '')),
cleanElectronVersion,
'-c.extraMetadata.version',
version,
// overrides the `name` in the `package.json` to keep the `localStorage` location. (https://github.com/arduino/arduino-ide/pull/2144#pullrequestreview-1554005028)
Expand All @@ -45,7 +51,11 @@ async function run() {
// updateChannel
// );
}
const cp = exec('electron-builder', args, { stdio: 'inherit' });
const cp = exec(
'DEBUG=* DEBUG_DMG=true ELECTRON_BUILDER_VERBOSE=true electron-builder',
args,
{ stdio: 'inherit' }
);
await cp;
}

Expand Down
Loading