diff options
-rw-r--r-- | .SRCINFO | 2 | ||||
-rw-r--r-- | PKGBUILD | 10 | ||||
-rw-r--r-- | blinker.sh | 5 |
3 files changed, 13 insertions, 4 deletions
@@ -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 @@ -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 |