diff options
author | Kristóf Marussy <kristof@marussy.com> | 2021-05-27 20:37:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-27 20:37:32 +0200 |
commit | 38de1e0cf41b9d5527d405952e2d66e983ca2a5c (patch) | |
tree | 0815e4e56dfecbdf1c8775a3954c601031b7a944 /src/index.js | |
parent | Use electronuserland base image so that we don't need to manually track all s... (diff) | |
download | ferdium-app-38de1e0cf41b9d5527d405952e2d66e983ca2a5c.tar.gz ferdium-app-38de1e0cf41b9d5527d405952e2d66e983ca2a5c.tar.zst ferdium-app-38de1e0cf41b9d5527d405952e2d66e983ca2a5c.zip |
Environmental variables for dev/production mode (#1455)
* Restore ELECTRON_IS_DEV environment variable
As part of migrating to @electron/remote from electron.remote, 296ce5ce6
removed the electron-is-dev package and with it the support of selecting
dev/production mode with the ELECTRON_IS_DEV environmental variable.
This commit restores support for this variable. Because even the newest
version of the electron-is-dev package breaks in renderer processes, we
instead query the environment ourselves.
* Add support for NODE_ENV variable
Also support NODE_ENV for specifying dev mode in addition to the
ELECTRON_IS_DEV variable. This variable is used by e.g., the packaging
in Arch Linux to trigger production mode with an explicit electron
command line invocation:
https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=ferdi-git&id=61dc59e5eb19a2c9e8f9edaf0a63aaae72990a0b#n109
* Refactor environmental variable handling
Diffstat (limited to 'src/index.js')
-rw-r--r-- | src/index.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/index.js b/src/index.js index ab4187e68..2586d7799 100644 --- a/src/index.js +++ b/src/index.js | |||
@@ -22,6 +22,7 @@ import { | |||
22 | } from './config'; | 22 | } from './config'; |
23 | 23 | ||
24 | import { | 24 | import { |
25 | isDevMode, | ||
25 | isMac, | 26 | isMac, |
26 | isWindows, | 27 | isWindows, |
27 | isLinux, | 28 | isLinux, |
@@ -40,7 +41,6 @@ if (process.env.FERDI_APPDATA_DIR != null) { | |||
40 | app.setPath('userData', path.join(app.getPath('appData'), app.name)); | 41 | app.setPath('userData', path.join(app.getPath('appData'), app.name)); |
41 | } | 42 | } |
42 | 43 | ||
43 | const isDevMode = !app.isPackaged; | ||
44 | if (isDevMode) { | 44 | if (isDevMode) { |
45 | app.setPath('userData', path.join(app.getPath('appData'), `${app.name}Dev`)); | 45 | app.setPath('userData', path.join(app.getPath('appData'), `${app.name}Dev`)); |
46 | } | 46 | } |