blob: 7f920657b04b9a73be4fef36ff71d5e1bfbc98bf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#!/usr/bin/bash
set -euo pipefail
name=@ELECTRON@
flags_file="${XDG_CONFIG_HOME:-$HOME/.config}/${name}-flags.conf"
fallback_file="${XDG_CONFIG_HOME:-$HOME/.config}/electron-flags.conf"
lines=()
if [[ -f "${flags_file}" ]]; then
mapfile -t lines < "${flags_file}"
elif [[ -f "${fallback_file}" ]]; then
mapfile -t lines < "${fallback_file}"
fi
flags=()
for line in "${lines[@]}"; do
if [[ ! "${line}" =~ ^[[:space:]]*#.* ]] && [[ -n "${line}" ]]; then
flags+=("${line}")
fi
done
: ${ELECTRON_IS_DEV:=0}
export ELECTRON_IS_DEV
: ${ELECTRON_FORCE_IS_PACKAGED:=true}
export ELECTRON_FORCE_IS_PACKAGED
exec /usr/lib/${name}/electron "${flags[@]}" "$@"
|