summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorSainnhepark2020-11-06 10:35:23 +0800
committerSainnhepark2020-11-06 10:35:23 +0800
commitc3e5078f089757ca556aebf48ef2ce40408ece25 (patch)
treee6e137eea2f12d4d4bb3b9c8df608ed62621aeb0
parentc87f3b3b874350b78ab8de9fe735b9f4551aaf2c (diff)
downloadaur-c3e5078f089757ca556aebf48ef2ce40408ece25.tar.gz
use yarn to install dependences
-rw-r--r--PKGBUILD15
1 files changed, 8 insertions, 7 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 4bbd7b60314f..b14bf292075b 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"