-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ef0c66a
commit ca3fc34
Showing
2 changed files
with
23 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,29 @@ | ||
#!/bin/bash | ||
set -e | ||
set -o pipefail | ||
_APPDIR="/usr/lib/@appname@" | ||
_RUNNAME="${_APPDIR}/@runname@" | ||
_CFGDIR="@cfgdirname@/" | ||
_OPTIONS="@options@" | ||
export PATH="${_APPDIR}:${PATH}" | ||
export LD_LIBRARY_PATH="${_APPDIR}/swiftshader:${_APPDIR}/lib:${LD_LIBRARY_PATH}" | ||
export ELECTRON_IS_DEV=0 | ||
export ELECTRON_FORCE_IS_PACKAGED=true | ||
export ELECTRON_DISABLE_SECURITY_WARNINGS=true | ||
export ELECTRON_OVERRIDE_DIST_PATH="/usr/bin/electron@electronversion@" | ||
export NODE_ENV=production | ||
export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}" | ||
export _FLAGS_FILE="${XDG_CONFIG_HOME}/${_CFGDIR}@appname@-flags.conf" | ||
declare -a _USER_FLAGS | ||
if [[ -f "${_FLAGS_FILE}" ]]; then | ||
while read -r line; do | ||
if [[ ! "${line}" =~ ^[[:space:]]*#.* ]]; then | ||
_USER_FLAGS+=("${line}") | ||
fi | ||
done < "${_FLAGS_FILE}" | ||
fi | ||
cd "${_APPDIR}" | ||
if [[ $EUID -ne 0 ]] || [[ $ELECTRON_RUN_AS_NODE ]]; then | ||
exec electron@electronversion@ "${_RUNNAME}" "${_OPTIONS}" "$@" || exit $? | ||
if [[ "${EUID}" -ne 0 ]] || [[ "${ELECTRON_RUN_AS_NODE}" ]]; then | ||
exec electron@electronversion@ "${_RUNNAME}" ${_OPTIONS} "${_USER_FLAGS[@]}" "$@" | ||
else | ||
exec electron@electronversion@ "${_RUNNAME}" "${_OPTIONS}" --no-sandbox "$@" || exit $? | ||
exec electron@electronversion@ "${_RUNNAME}" ${_OPTIONS} --no-sandbox "${_USER_FLAGS[@]}" "$@" | ||
fi |