From b8d16c6e4ddf0fdcc75c3474631a7660b670d2f1 Mon Sep 17 00:00:00 2001 From: Jiiks Date: Thu, 28 Feb 2019 17:07:53 +0200 Subject: [PATCH] Load correct editor file --- core/src/modules/editor.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/src/modules/editor.js b/core/src/modules/editor.js index 1e7860cb..4ee55e6e 100644 --- a/core/src/modules/editor.js +++ b/core/src/modules/editor.js @@ -209,7 +209,13 @@ export default class Editor extends Module { * Opens an editor. * @return {Promise} */ - openEditor(options) { + async openEditor(options) { + if (!this.editorPkg) { + this.editorPkg = await FileUtils.readJsonFromFile(path.join(this.editorPath, 'package.json')); + } + + console.log(this.editorPkg); + return new Promise((resolve, reject) => { if (this.editor) { if (this.editor.isFocused()) return; @@ -236,7 +242,7 @@ export default class Editor extends Module { }); this.editor.webContents.on('did-finish-load', () => { - this.editorUtils.injectScript(path.join(this.editorPath, 'editor.js')); + this.editorUtils.injectScript(path.join(this.editorPath, this.editorPkg.main)); resolve(true); }); })