summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorSainnhepark2020-11-05 21:12:33 +0800
committerSainnhepark2020-11-05 21:12:33 +0800
commit2ce79b233ce42f6e8302ab2f53b948f4ceef7d20 (patch)
tree8520fe62783b00915e4d80e80f5b7b874ca223c0
parent6c563020ed2974794a48def787826179afa121c3 (diff)
downloadaur-2ce79b233ce42f6e8302ab2f53b948f4ceef7d20.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 e9e8ef1eaa8..97f43d808fa 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"