diff options
author | zxp19821005 | 2024-05-24 11:06:57 +0800 |
---|---|---|
committer | zxp19821005 | 2024-05-24 11:06:57 +0800 |
commit | c494b2fb5a818ae3cc7d14e25707cc65e236fd28 (patch) | |
tree | a8ffa92f1456c82e5d994b1bb5ec05a85b51a38a | |
parent | cddea1cf49d30fd212fc0b8e36ce4ac3755e24df (diff) | |
download | aur-knowte-bin.tar.gz |
fix errors
-rw-r--r-- | .SRCINFO | 7 | ||||
-rw-r--r-- | PKGBUILD | 8 | ||||
-rw-r--r-- | knowte.sh | 21 |
3 files changed, 24 insertions, 12 deletions
@@ -1,17 +1,16 @@ pkgbase = knowte-bin pkgdesc = A note taking application that allows you to quickly and easily organize and find your notes. pkgver = 3.0.0 - pkgrel = 4 + pkgrel = 5 url = https://github.com/digimezzo/knowte arch = x86_64 license = GPL-3.0-only - depends = electron17-bin - depends = hicolor-icon-theme + depends = electron17 provides = knowte=3.0.0 conflicts = knowte source = knowte-3.0.0.pacman::https://github.com/digimezzo/knowte/releases/download/v3.0.0/Knowte-3.0.0.pacman source = knowte.sh sha256sums = 6f7ad45262020e24c66536d627442b27601109d434e0d5870de2d48519fe2750 - sha256sums = dc0c5ca385ad81a08315a91655c7c064b5bf110eada55e61265633ae198b39f8 + sha256sums = 2b2e8aeed33fd71c521e49fd54fb2fa81218d16aef8bccb88d77909055ab8051 pkgname = knowte-bin @@ -3,7 +3,7 @@ pkgname=knowte-bin _pkgname=Knowte pkgver=3.0.0 _electronversion=17 -pkgrel=4 +pkgrel=5 pkgdesc="A note taking application that allows you to quickly and easily organize and find your notes." arch=('x86_64') url="https://github.com/digimezzo/knowte" @@ -11,19 +11,19 @@ license=('GPL-3.0-only') provides=("${pkgname%-bin}=${pkgver}") conflicts=("${pkgname%-bin}") depends=( - "electron${_electronversion}-bin" - 'hicolor-icon-theme' + "electron${_electronversion}" ) source=( "${pkgname%-bin}-${pkgver}.pacman::${url}/releases/download/v${pkgver}/${_pkgname}-${pkgver}.pacman" "${pkgname%-bin}.sh" ) sha256sums=('6f7ad45262020e24c66536d627442b27601109d434e0d5870de2d48519fe2750' - 'dc0c5ca385ad81a08315a91655c7c064b5bf110eada55e61265633ae198b39f8') + '2b2e8aeed33fd71c521e49fd54fb2fa81218d16aef8bccb88d77909055ab8051') build() { sed -e "s|@electronversion@|${_electronversion}|" \ -e "s|@appname@|${pkgname%-bin}|g" \ -e "s|@appasar@|app.asar|g" \ + -e "s|@cfgdirname@|${_pkgname}|g" \ -e "s|@options@||g" \ -i "${srcdir}/${pkgname%-bin}.sh" sed "s|/opt/${_pkgname}/${pkgname%-bin}|${pkgname%-bin}|g" -i "${srcdir}/usr/share/applications/${pkgname%-bin}.desktop" diff --git a/knowte.sh b/knowte.sh index 7ddcaab8d734..4cfe3ac09dd8 100644 --- a/knowte.sh +++ b/knowte.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 |