diff options
author | Sainnhepark | 2020-11-06 10:40:27 +0800 |
---|---|---|
committer | Sainnhepark | 2020-11-06 10:40:27 +0800 |
commit | 46f17356f050c8dcada461e3ea75ec35c6c7c94a (patch) | |
tree | cf498fca26e430538e8d20b96e304c6fd9847d58 | |
parent | 17c641afa23fffcb144dce6ce6aed80264d19ee1 (diff) | |
download | aur-46f17356f050c8dcada461e3ea75ec35c6c7c94a.tar.gz |
use yarn to install dependences
-rw-r--r-- | PKGBUILD | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -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" |