summarylogtreecommitdiffstats
path: root/chain-desktop-wallet.sh
diff options
context:
space:
mode:
authorzxp198210052024-05-13 13:35:11 +0800
committerzxp198210052024-05-13 13:35:11 +0800
commite87aa1f9bcacfe407002df2e9e8c5d629328c340 (patch)
treebdea0b89da4d1cbee32434c4eb738355f446a6f5 /chain-desktop-wallet.sh
parent19fe9cfd64f7c54a1ded966a380433702eb0fe79 (diff)
downloadaur-chain-desktop-wallet-bin.tar.gz
fix errors
Diffstat (limited to 'chain-desktop-wallet.sh')
-rw-r--r--chain-desktop-wallet.sh21
1 files changed, 17 insertions, 4 deletions
diff --git a/chain-desktop-wallet.sh b/chain-desktop-wallet.sh
index 7ddcaab8d734..398398461fee 100644
--- a/chain-desktop-wallet.sh
+++ b/chain-desktop-wallet.sh
@@ -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 \ No newline at end of file