# Maintainer: Dimitris Kiziridis pkgname=release-it pkgver=13.3.0 pkgrel=1 pkgdesc="Automate versioning and package publishing" arch=('x86_64') url='https://github.com/release-it/release-it' license=('MIT') makedepends=('npm') noextract=("${pkgname}-${pkgver}.tar.gz") source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/${pkgver}.tar.gz") md5sums=('9e476bee7b5f8e903410211758bfae12') package() { npm install -g --user root --prefix "${pkgdir}/usr" "${srcdir}/${pkgname}-${pkgver}.tar.gz" find "$pkgdir" -name package.json -print0 | xargs -r -0 sed -i '/_where/d' find "${pkgdir}/usr" -type d -exec chmod 755 {} + local tmppackage="$(mktemp)" local pkgjson="$pkgdir/usr/lib/node_modules/$pkgname/package.json" jq '.|=with_entries(select(.key|test("_.+")|not))' "$pkgjson" > "$tmppackage" mv "$tmppackage" "$pkgjson" chmod 644 "$pkgjson" chown -R root:root "${pkgdir}" }