Skip to content

Commit

Permalink
fix #4871: remove electron runtime dependency from CLI
Browse files Browse the repository at this point in the history
Signed-off-by: Anton Kosyakov <[email protected]>
  • Loading branch information
akosyakov committed Apr 11, 2019
1 parent a33a2e2 commit 0dbfbb3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
1 change: 0 additions & 1 deletion dev-packages/application-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
},
"dependencies": {
"@theia/application-package": "^0.5.0",
"@theia/electron": "^0.5.0",
"@types/fs-extra": "^4.0.2",
"bunyan": "^1.8.10",
"circular-dependency-plugin": "^5.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ export class ApplicationPackageManager {
}

async startElectron(args: string[]): Promise<void> {
this.__process.spawnBin('electron', [this.pck.frontend('electron-main.js'), ...args],
const electronCli = require.resolve('electron/cli.js', { paths: [this.pck.projectPath] });
this.process.spawn(electronCli, [this.pck.frontend('electron-main.js'), ...args],
{ stdio: [0, 1, 2] });
}

Expand Down
4 changes: 2 additions & 2 deletions dev-packages/application-package/src/application-package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ export class ApplicationPackage {
if (this.isElectron()) {
const { version } = require('../package.json');
try {
require('@theia/electron/package.json');
require.resolve('@theia/electron/package.json', { paths: [this.projectPath] });
} catch {
console.warn(`please install @theia/electorn@${version} as a runtime dependency`);
console.warn(`please install @theia/electron@${version} as a runtime dependency`);
}
}
}
Expand Down

0 comments on commit 0dbfbb3

Please sign in to comment.