summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorSainnhepark2020-11-06 10:35:40 +0800
committerSainnhepark2020-11-06 10:35:40 +0800
commitcd76046983442e7f064261f9abc972c0c546f4b6 (patch)
tree359beed4770ad0d31730c5967009e8d848ce48ad
parent61f38ead4d7f8e45d5f9d42ec886d07fe3b42a07 (diff)
downloadaur-cd76046983442e7f064261f9abc972c0c546f4b6.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 c5ed42f651c..a17f3730fab 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"