summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorzxp198210052024-03-13 11:47:03 +0800
committerzxp198210052024-03-13 11:47:03 +0800
commit0b2887a7a25f10cc2ea6c245a82058b17c1c139e (patch)
treef0eecc8bdc8dd7ab23a799099697e52a17459b8c
parent3a4047abcff7e29543d159abd6189e55e4c1e63f (diff)
downloadaur-0b2887a7a25f10cc2ea6c245a82058b17c1c139e.tar.gz
fix errors
-rw-r--r--.SRCINFO5
-rw-r--r--PKGBUILD16
-rw-r--r--nudge.sh8
3 files changed, 21 insertions, 8 deletions
diff --git a/.SRCINFO b/.SRCINFO
index bcea0f4886bf..298fefa0845b 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = nudge
pkgdesc = An electron-powered application focused on personal health
pkgver = 0.4
- pkgrel = 6
+ pkgrel = 7
url = https://github.com/aasmart/Nudge
arch = any
license = MIT
@@ -11,9 +11,10 @@ pkgbase = nudge
makedepends = git
depends = electron23
conflicts = nudge
+ options = !emptydirs
source = nudge.git::git+https://github.com/aasmart/Nudge.git#tag=v0.4
source = nudge.sh
sha256sums = SKIP
- sha256sums = 0fb7b939a071f4a08476bdd5aa143d2aa8cd335c83309f9919be16cd5c3e2014
+ sha256sums = dc0c5ca385ad81a08315a91655c7c064b5bf110eada55e61265633ae198b39f8
pkgname = nudge
diff --git a/PKGBUILD b/PKGBUILD
index 60df579e1ad3..c6269d703b52 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,7 +4,7 @@ _appname=Nudge
pkgver=0.4
_electronversion=23
_nodeversion=16
-pkgrel=6
+pkgrel=7
pkgdesc="An electron-powered application focused on personal health"
arch=('any')
url="https://github.com/aasmart/Nudge"
@@ -19,12 +19,15 @@ makedepends=(
'nvm'
'git'
)
+options=(
+ '!emptydirs'
+)
source=(
"${pkgname}.git::git+${url}.git#tag=v${pkgver}"
"${pkgname}.sh"
)
sha256sums=('SKIP'
- '0fb7b939a071f4a08476bdd5aa143d2aa8cd335c83309f9919be16cd5c3e2014')
+ 'dc0c5ca385ad81a08315a91655c7c064b5bf110eada55e61265633ae198b39f8')
_ensure_local_nvm() {
export NVM_DIR="${srcdir}/.nvm"
source /usr/share/nvm/init-nvm.sh || [[ $? != 1 ]]
@@ -35,6 +38,7 @@ build() {
sed -e "s|@electronversion@|${_electronversion}|" \
-e "s|@appname@|${pkgname}|g" \
-e "s|@runname@|app|g" \
+ -e "s|@options@||g" \
-i "${srcdir}/${pkgname}.sh"
_ensure_local_nvm
gendesk -f -n -q --categories="Utility" --name="${_appname}" --exec="${pkgname} %U"
@@ -47,7 +51,13 @@ build() {
export ELECTRONVERSION="${_electronversion}"
export npm_config_disturl=https://electronjs.org/headers
HOME="${srcdir}/.electron-gyp"
- sed '19,22d' -i forge.config.js
+ if [ `curl ifconfig.co/country` = "China" ];then
+ echo 'registry="https://registry.npmmirror.com/"' >> .npmrc
+ echo 'electron_mirror="https://registry.npmmirror.com/-/binary/electron/"' >> .npmrc
+ echo 'electron_builder_binaries_mirror="https://registry.npmmirror.com/-/binary/electron-builder-binaries/"' >> .npmrc
+ else
+ echo "Your network is OK."
+ fi
npm install
npm run package
}
diff --git a/nudge.sh b/nudge.sh
index f9ced1432cfc..7ddcaab8d734 100644
--- a/nudge.sh
+++ b/nudge.sh
@@ -1,14 +1,16 @@
-#!/bin/sh
+#!/bin/bash
set -e
_APPDIR="/usr/lib/@appname@"
_RUNNAME="${_APPDIR}/@runname@"
+_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 NODE_ENV=production
cd "${_APPDIR}"
if [[ $EUID -ne 0 ]] || [[ $ELECTRON_RUN_AS_NODE ]]; then
- exec electron@electronversion@ "${_RUNNAME}" "$@" || exit $?
+ exec electron@electronversion@ "${_RUNNAME}" "${_OPTIONS}" "$@" || exit $?
else
- exec electron@electronversion@ "${_RUNNAME}" --no-sandbox "$@" || exit $?
+ exec electron@electronversion@ "${_RUNNAME}" "${_OPTIONS}" --no-sandbox "$@" || exit $?
fi \ No newline at end of file