mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-17 10:50:06 -04:00
chore: provide a script to repin a language
This commit is contained in:
parent
0286b72809
commit
012e2161e3
1 changed files with 21 additions and 0 deletions
21
scripts/update-lockfile.sh
Executable file
21
scripts/update-lockfile.sh
Executable file
|
|
@ -0,0 +1,21 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
make_ignored() {
|
||||||
|
if [ -n "$1" ]
|
||||||
|
then
|
||||||
|
jq keys < lockfile.json | tail --line=+2 | head --lines=-1 | tr -d "\" ," | while read lang
|
||||||
|
do
|
||||||
|
if [ "$lang" != "$1" ]
|
||||||
|
then
|
||||||
|
printf "$lang,"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
TO_IGNORE=$(make_ignored $1)
|
||||||
|
|
||||||
|
SKIP_LOCKFILE_UPDATE_FOR_LANGS="$TO_IGNORE" nvim --headless -c "luafile ./scripts/write-lockfile.lua" -c "q"
|
||||||
|
# Pretty print
|
||||||
|
cp lockfile.json /tmp/lockfile.json
|
||||||
|
cat /tmp/lockfile.json | jq --sort-keys > lockfile.json
|
||||||
Loading…
Add table
Add a link
Reference in a new issue