mirror of
https://github.com/luzifer-aur/babel-eslint-parser.git
synced 2024-12-20 13:41:15 +00:00
Initial version
This commit is contained in:
commit
87674423a3
4 changed files with 69 additions and 0 deletions
1
.SRCINFO
Normal file
1
.SRCINFO
Normal file
|
@ -0,0 +1 @@
|
|||
|
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
*.tar.zst
|
||||
*.tgz
|
29
PKGBUILD
Normal file
29
PKGBUILD
Normal 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
37
update_version.sh
Executable 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}"
|
Loading…
Reference in a new issue