mirror of
https://github.com/balena-io/etcher.git
synced 2025-04-21 05:47:18 +00:00

Electron's `shell.openExternal()` fails on GNU/Linux when Electron is ran with `sudo`. The issue was reported, and this is a workaround until its fixed on the Electron side. `node-open` is smart enough to check the `$SUDO_USER` environment variable and to prepend `sudo -u <user>` if needed. We keep `shell.openExternal()` for OSes other than Linux since we intend to fully rely on it when the issue is fixed, and since its closer integration with the operating system might lead to more accurate results than a third party NPM module. See https://github.com/electron/electron/issues/5039 Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>