summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorSainnhepark2020-11-06 10:49:04 +0800
committerSainnhepark2020-11-06 10:49:04 +0800
commit0df173462ecc6d8e6aa825fa1b8937134eb39691 (patch)
treed6c37a3c9d114ab88902bba083702713591b20ee /PKGBUILD
parent4269bf1e27b1bf134bbe882497ae9a5dc665ba1c (diff)
downloadaur-0df173462ecc6d8e6aa825fa1b8937134eb39691.tar.gz
use yarn to install dependences
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD15
1 files changed, 8 insertions, 7 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 5e84b5620a57..3ad18f2b7107 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -24,16 +24,17 @@ pkgver() {
build() {
cd "${srcdir}/${_extname}"
- yarn install --frozen-lockfile --preferred-cache-folder "${srcdir}/.cache/yarn"
- yarn pack
- tar xvf *.tgz
- rm *.tgz
- cd package
- npm install --only=production --no-lockfile --ignore-scripts --cache "${srcdir}/.cache/npm"
+ yarn install --frozen-lockfile --preferred-cache-folder "${srcdir}/.cache"
}
package() {
- cd "${srcdir}/${_extname}/package"
+ cd "${srcdir}/${_extname}"
+ yarn pack; tar xvf *.tgz; rm *.tgz
+ cd package
+ _dependencies=$(grep -Po '"dependencies":' package.json) || _dependencies=""
+ if [ -n "${_dependencies}" ]; then
+ yarn install --production --no-lockfile --ignore-scripts --prefer-offline --preferred-cache-folder "${srcdir}/.cache"
+ fi
find . -type f -exec \
install -Dm 644 '{}' "${pkgdir}/${_packdir}/{}" \;
rm -rf "${srcdir}/${_extname}/package"