summarylogtreecommitdiffstats
path: root/electron-launcher.sh
diff options
context:
space:
mode:
Diffstat (limited to 'electron-launcher.sh')
-rw-r--r--electron-launcher.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/electron-launcher.sh b/electron-launcher.sh
new file mode 100644
index 000000000000..82df9a5331f8
--- /dev/null
+++ b/electron-launcher.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+set -eu -o pipefail
+
+basename='{{basename}}'
+flags_file="${XDG_CONFIG_HOME:-${HOME}/.config}/${basename}-flags.conf"
+flags=()
+
+if [[ ! -e "${flags_file}" ]]; then
+ flags_file="/etc/${basename}-flags.conf"
+fi
+
+if [[ -e "${flags_file}" ]]; then
+ while read -r flag; do
+ if [[ "${flag}" != *(' ')'#'* ]]; then
+ flags+=("${flag}")
+ fi
+ done < "${flags_file}"
+fi
+
+exec '{{executable}}' "${flags[@]}" "$@"