diff options
author | zxp19821005 | 2024-05-24 12:13:52 +0800 |
---|---|---|
committer | zxp19821005 | 2024-05-24 12:13:52 +0800 |
commit | b56e6773ba1f6b9e84809da381fc82a1fd20591b (patch) | |
tree | 921d66cd5fac0757ba1d0bb748a43b5c5b3e7f3e | |
parent | d6037e25e393ec56d2bf896b76b6b382a6ae0c57 (diff) | |
download | aur-enotebook-bin.tar.gz |
fix errors
-rw-r--r-- | .SRCINFO | 5 | ||||
-rw-r--r-- | PKGBUILD | 6 | ||||
-rw-r--r-- | enotebook.sh | 21 |
3 files changed, 22 insertions, 10 deletions
@@ -1,17 +1,16 @@ pkgbase = enotebook-bin pkgdesc = Opensource desktop app to create and store notes. pkgver = 1.0.0 - pkgrel = 5 + pkgrel = 6 url = https://enotebook-react.vercel.app/ arch = x86_64 license = LicenseRef-custom depends = electron27 - depends = hicolor-icon-theme provides = enotebook=1.0.0 conflicts = enotebook source = enotebook-1.0.0.deb::https://github.com/aestrus219/eNotebook/releases/download/v1.0.0/eNotebook@1.0.0-linux.deb source = enotebook.sh sha256sums = 6eeb0514b9690bdef6c4d5cc8ea991f76fe12fdff6d616c2945df704b7a26efa - sha256sums = dc0c5ca385ad81a08315a91655c7c064b5bf110eada55e61265633ae198b39f8 + sha256sums = 2b2e8aeed33fd71c521e49fd54fb2fa81218d16aef8bccb88d77909055ab8051 pkgname = enotebook-bin @@ -3,7 +3,7 @@ pkgname=enotebook-bin _pkgname=eNotebook pkgver=1.0.0 _electronversion=27 -pkgrel=5 +pkgrel=6 pkgdesc="Opensource desktop app to create and store notes." arch=('x86_64') url="https://enotebook-react.vercel.app/" @@ -13,18 +13,18 @@ conflicts=("${pkgname%-bin}") provides=("${pkgname%-bin}=${pkgver}") depends=( "electron${_electronversion}" - 'hicolor-icon-theme' ) source=( "${pkgname%-bin}-${pkgver}.deb::${_ghurl}/releases/download/v${pkgver}/${_pkgname}@${pkgver}-linux.deb" "${pkgname%-bin}.sh" ) sha256sums=('6eeb0514b9690bdef6c4d5cc8ea991f76fe12fdff6d616c2945df704b7a26efa' - 'dc0c5ca385ad81a08315a91655c7c064b5bf110eada55e61265633ae198b39f8') + '2b2e8aeed33fd71c521e49fd54fb2fa81218d16aef8bccb88d77909055ab8051') build() { sed -e "s|@electronversion@|${_electronversion}|" \ -e "s|@appname@|${pkgname%-bin}|g" \ -e "s|@runname@|app.asar|g" \ + -e "s|@cfgdirname@|${pkgname%-bin}|g" \ -e "s|@options@||g" \ -i "${srcdir}/${pkgname%-bin}.sh" bsdtar -xf "${srcdir}/data."* diff --git a/enotebook.sh b/enotebook.sh index 7ddcaab8d734..4cfe3ac09dd8 100644 --- a/enotebook.sh +++ b/enotebook.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 |