From 1098f8cb1e7e209cc29cb7b3953dacf9fa671bf6 Mon Sep 17 00:00:00 2001 From: Alexis Svinartchouk Date: Fri, 11 Oct 2019 14:58:30 +0200 Subject: [PATCH] Use the same entrypoint for etcher and the child writer Changelog-entry: Use the same entrypoint for etcher and the child writer Change-type: patch --- lib/start.js | 9 +++------ package.json | 2 +- webpack.config.js | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/lib/start.js b/lib/start.js index 562e6ec1..7dfe96d9 100644 --- a/lib/start.js +++ b/lib/start.js @@ -22,12 +22,9 @@ // *won't* attempt to load the `app.asar` application by default, therefore // if passing `ELECTRON_RUN_AS_NODE`, you have to pass the path to the asar // or the entry point file (this file) manually as an argument. -// -// We also consider `ATOM_SHELL_INTERNAL_RUN_AS_NODE`, which is basically -// an older equivalent of `ELECTRON_RUN_AS_NODE` that still gets set when -// using `child_process.fork()`. -if (process.env.ELECTRON_RUN_AS_NODE || process.env.ATOM_SHELL_INTERNAL_RUN_AS_NODE) { + +if (process.env.ELECTRON_RUN_AS_NODE) { require('./gui/modules/child-writer') } else { - require('../generated/etcher') + require('./gui/etcher') } diff --git a/package.json b/package.json index a6129040..f67557ee 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "sleepDays": 7, "semverRange": "<2.0.0" }, - "main": "lib/start.js", + "main": "generated/etcher.js", "description": "Flash OS images to SD cards and USB drives, safely and easily.", "productDescription": "Etcher is a powerful OS image flasher built with web technologies to ensure flashing an SDCard or USB drive is a pleasant and safe experience. It protects you from accidentally writing to your hard-drives, ensures every byte of data was written correctly and much more.", "homepage": "https://github.com/balena-io/etcher", diff --git a/webpack.config.js b/webpack.config.js index 9ba522ed..5d9e5a9a 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -145,7 +145,7 @@ const etcherConfig = _.assign({ } ], entry: { - etcher: path.join(__dirname, 'lib', 'gui', 'etcher.js') + etcher: path.join(__dirname, 'lib', 'start.js') }, output: { path: path.join(__dirname, 'generated'),