aboutsummaryrefslogtreecommitdiffstats
path: root/testing/electron/electron-launcher.sh
diff options
context:
space:
mode:
Diffstat (limited to 'testing/electron/electron-launcher.sh')
-rw-r--r--testing/electron/electron-launcher.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/testing/electron/electron-launcher.sh b/testing/electron/electron-launcher.sh
new file mode 100644
index 00000000000..546d4ccb1c4
--- /dev/null
+++ b/testing/electron/electron-launcher.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+# Allow the user to override command-line flags
+# This is based on Debian's chromium-browser package, and is intended
+# to be consistent with Debian.
+for f in /etc/electron/*.conf; do
+ [ -f ${f} ] && . "${f}"
+done
+
+# Prefer user defined ELECTRON_USER_FLAGS (from env) over system
+# default ELECTRON_FLAGS (from /etc/electron/default.conf).
+export ELECTRON_FLAGS="$ELECTRON_FLAGS ${ELECTRON_USER_FLAGS:-"$ELECTRON_USER_FLAGS"}"
+# Re-export, for it to be accessible by the process
+export ELECTRON_OZONE_PLATFORM_HINT="${ELECTRON_OZONE_PLATFORM_HINT}"
+
+if [ "$ELECTRON_RUN_AS_NODE" == "1" ] && [ "$ELECTRON_STILL_PASS_THE_DEFAULT_FLAGS" != "1" ]; then
+ exec "/usr/lib/electron/electron" "$@"
+fi
+
+exec "/usr/lib/electron/electron" "$@" ${ELECTRON_FLAGS}