Initial version

This commit is contained in:
Knut Ahlers 2021-11-14 16:06:58 +01:00
commit 87674423a3
Signed by: luzifer
GPG key ID: 0066F03ED215AD7D
4 changed files with 69 additions and 0 deletions

1
.SRCINFO Normal file
View file

@ -0,0 +1 @@

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
*.tar.zst
*.tgz

29
PKGBUILD Normal file
View file

@ -0,0 +1,29 @@
# Maintainer: Knut Ahlers <knut at ahlers dot me>
pkgname=babel-eslint-plugin
pkgver=7.16.2
pkgrel=1
pkgdesc='@babel/eslint-parser allows you to lint ALL valid Babel code with the fantastic ESLint'
arch=('any')
url='https://github.com/babel/babel'
license=('MIT')
depends=('eslint')
makedepends=('npm')
source=("https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-${pkgver}.tgz")
sha256sums=('adcfa77797fd2a96598ae8f2f320ef88e36ea719e8b540fab56809551d3130c2')
noextract=("eslint-parser-${pkgver}.tgz")
package() {
install -dm 755 "$pkgdir/usr/lib"
npm install -g --prefix "$pkgdir"/usr "$srcdir"/eslint-parser-${pkgver}.tgz
# Fix permissions
find "$pkgdir/usr" -type d -exec chmod 755 '{}' +
# Remove files that conflict with `eslint`:
rm -rf "$pkgdir/usr/lib/node_modules/eslint"
rm -rf "$pkgdir/usr/bin"
install -dm755 "${pkgdir}/usr/share/licenses/${pkgname}"
ln -s ../../../lib/node_modules/@babel/eslint-parser/LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}

37
update_version.sh Executable file
View file

@ -0,0 +1,37 @@
#!/bin/bash
set -euxo pipefail
# Read pkg name
PKG=$(awk -F '=' '/pkgname=/{ print $2 }' PKGBUILD)
# Get latest version
VER=$(
npm view @babel/eslint-parser dist-tags.latest
)
[[ -n $VER ]] || exit 1
# Insert latest version into PKGBUILD
sed -i \
-e "s/^pkgver=.*/pkgver=${VER}/" \
PKGBUILD
# Check whether this changed anything
if (git diff --exit-code PKGBUILD); then
echo "Package ${PKG} has most recent version ${VER}"
exit 0
fi
# Reset pkgrel
sed -i \
-e 's/pkgrel=.*/pkgrel=1/' \
PKGBUILD
# Update source hashes
updpkgsums
# Update .SRCINFO
makepkg --printsrcinfo >.SRCINFO
# Commit changes
git add PKGBUILD .SRCINFO
git commit -m "${PKG} v${VER}"