summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorzxp198210052024-03-21 15:40:23 +0800
committerzxp198210052024-03-21 15:40:23 +0800
commitabde536535f2e918755e4fdab76d51d7c6dfe1ad (patch)
tree6d65d2c222316e8b5cc490e97727337aaee98623
parent3a46b24dbb0f7c088300844bd87de1ca8975e72c (diff)
downloadaur-blinker-git.tar.gz
fix errors
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD10
-rw-r--r--blinker.sh5
3 files changed, 13 insertions, 4 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 1038b0c84665..cba1f04330d3 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -19,6 +19,6 @@ pkgbase = blinker-git
source = blinker.git::git+https://github.com/mrkpatchaa/blinker.git
source = blinker.sh
sha256sums = SKIP
- sha256sums = 50b10386d13e5bec806aeb78f819c4edd0208a4d184332e53866c802731217fe
+ sha256sums = dc0c5ca385ad81a08315a91655c7c064b5bf110eada55e61265633ae198b39f8
pkgname = blinker-git
diff --git a/PKGBUILD b/PKGBUILD
index e3ab2a2a4e9d..0d4305ea401e 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -28,7 +28,7 @@ source=(
)
options=('!emptydirs')
sha256sums=('SKIP'
- '50b10386d13e5bec806aeb78f819c4edd0208a4d184332e53866c802731217fe')
+ 'dc0c5ca385ad81a08315a91655c7c064b5bf110eada55e61265633ae198b39f8')
pkgver() {
cd "${srcdir}/${pkgname//-/.}"
git describe --long --tags --exclude='*[a-z][a-z]*' | sed -E 's/^v//;s/([^-]*-g)/r\1/;s/-/./g'
@@ -43,6 +43,7 @@ build() {
sed -e "s|@electronversion@|${_electronversion}|" \
-e "s|@appname@|${pkgname%-git}|g" \
-e "s|@runname@|app|g" \
+ -e "s|@options@||g" \
-i "${srcdir}/${pkgname%-git}.sh"
_ensure_local_nvm
gendesk -q -f -n --categories="Utility" --name="${pkgname%-git}" --exec="${pkgname%-git} %U"
@@ -55,6 +56,13 @@ build() {
export ELECTRONVERSION="${_electronversion}"
export npm_config_disturl=https://electronjs.org/headers
HOME="${srcdir}/.electron-gyp"
+ if [ `curl -s ipinfo.io/country | grep CN | wc -l ` -ge 1 ];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/blinker.sh b/blinker.sh
index 86cb3dc6a9bf..7ddcaab8d734 100644
--- a/blinker.sh
+++ b/blinker.sh
@@ -2,6 +2,7 @@
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
@@ -9,7 +10,7 @@ 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