aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/update-lockfile.sh
diff options
context:
space:
mode:
authorThomas Vigouroux <tomvig38@gmail.com>2021-08-20 10:08:55 +0200
committerStephan Seitz <stephan.seitz@fau.de>2021-08-23 09:18:03 +0200
commit012e2161e39783b5a3e8cfd9300659d3a60e2b38 (patch)
tree4ef2d4b42b431742fa666a21c7e5b86edaa073d2 /scripts/update-lockfile.sh
parentUpdate lockfile.json (diff)
downloadnvim-treesitter-012e2161e39783b5a3e8cfd9300659d3a60e2b38.tar
nvim-treesitter-012e2161e39783b5a3e8cfd9300659d3a60e2b38.tar.gz
nvim-treesitter-012e2161e39783b5a3e8cfd9300659d3a60e2b38.tar.bz2
nvim-treesitter-012e2161e39783b5a3e8cfd9300659d3a60e2b38.tar.lz
nvim-treesitter-012e2161e39783b5a3e8cfd9300659d3a60e2b38.tar.xz
nvim-treesitter-012e2161e39783b5a3e8cfd9300659d3a60e2b38.tar.zst
nvim-treesitter-012e2161e39783b5a3e8cfd9300659d3a60e2b38.zip
chore: provide a script to repin a language
Diffstat (limited to 'scripts/update-lockfile.sh')
-rwxr-xr-xscripts/update-lockfile.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/scripts/update-lockfile.sh b/scripts/update-lockfile.sh
new file mode 100755
index 000000000..1ba57ff21
--- /dev/null
+++ b/scripts/update-lockfile.sh
@@ -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