aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorObserverOfTime <chronobserver@disroot.org>2024-03-11 18:58:08 +0200
committerObserverOfTime <chronobserver@disroot.org>2024-03-12 09:55:48 +0200
commit8d3176cfbc0e3c5b8eadf4dfc20681878529c3af (patch)
tree3f4466507a9c2018ae48691896c2968811edb964 /scripts
parentfix(php): highlight property access using nullsafe operator, move `@property`... (diff)
downloadnvim-treesitter-8d3176cfbc0e3c5b8eadf4dfc20681878529c3af.tar
nvim-treesitter-8d3176cfbc0e3c5b8eadf4dfc20681878529c3af.tar.gz
nvim-treesitter-8d3176cfbc0e3c5b8eadf4dfc20681878529c3af.tar.bz2
nvim-treesitter-8d3176cfbc0e3c5b8eadf4dfc20681878529c3af.tar.lz
nvim-treesitter-8d3176cfbc0e3c5b8eadf4dfc20681878529c3af.tar.xz
nvim-treesitter-8d3176cfbc0e3c5b8eadf4dfc20681878529c3af.tar.zst
nvim-treesitter-8d3176cfbc0e3c5b8eadf4dfc20681878529c3af.zip
fix(scripts): actually skip lockfile updates
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/update-lockfile.sh16
-rwxr-xr-xscripts/write-lockfile.lua1
2 files changed, 7 insertions, 10 deletions
diff --git a/scripts/update-lockfile.sh b/scripts/update-lockfile.sh
index 8fcf553ed..22460d14b 100755
--- a/scripts/update-lockfile.sh
+++ b/scripts/update-lockfile.sh
@@ -1,20 +1,18 @@
#!/usr/bin/env bash
make_ignored() {
- if [ -n "$1" ]
- then
+ if [[ -n $1 ]]; then
while read -r lang; do
- if [ "$lang" != "$1" ]
- then
- printf "%s," "$lang"
+ if [[ $lang != "$1" ]]; then
+ printf '%s,' "$lang"
fi
- done < <(jq 'keys|@sh' -c lockfile.json)
+ done < <(jq -r 'keys[]' lockfile.json)
fi
}
-TO_IGNORE=$(make_ignored $1)
+SKIP_LOCKFILE_UPDATE_FOR_LANGS="$(make_ignored "$1")" \
+ nvim --headless -c 'luafile ./scripts/write-lockfile.lua' +q
-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
+jq --sort-keys > lockfile.json < /tmp/lockfile.json
diff --git a/scripts/write-lockfile.lua b/scripts/write-lockfile.lua
index c1d5d6d8d..7a7606c51 100755
--- a/scripts/write-lockfile.lua
+++ b/scripts/write-lockfile.lua
@@ -10,6 +10,5 @@ else
skip_langs = vim.fn.split(skip_langs, ",")
end
-print("Skipping languages: " .. vim.inspect(skip_langs))
require("nvim-treesitter.install").write_lockfile("verbose", skip_langs)
vim.cmd "q"