fix(scripts): actually skip lockfile updates

This commit is contained in:
ObserverOfTime 2024-03-11 18:58:08 +02:00
parent 9d39f00a95
commit 8d3176cfbc
2 changed files with 7 additions and 10 deletions

View file

@ -1,20 +1,18 @@
#!/usr/bin/env bash #!/usr/bin/env bash
make_ignored() { make_ignored() {
if [ -n "$1" ] if [[ -n $1 ]]; then
then
while read -r lang; do while read -r lang; do
if [ "$lang" != "$1" ] if [[ $lang != "$1" ]]; then
then printf '%s,' "$lang"
printf "%s," "$lang"
fi fi
done < <(jq 'keys|@sh' -c lockfile.json) done < <(jq -r 'keys[]' lockfile.json)
fi 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 # Pretty print
cp lockfile.json /tmp/lockfile.json cp lockfile.json /tmp/lockfile.json
cat /tmp/lockfile.json | jq --sort-keys > lockfile.json jq --sort-keys > lockfile.json < /tmp/lockfile.json

View file

@ -10,6 +10,5 @@ else
skip_langs = vim.fn.split(skip_langs, ",") skip_langs = vim.fn.split(skip_langs, ",")
end end
print("Skipping languages: " .. vim.inspect(skip_langs))
require("nvim-treesitter.install").write_lockfile("verbose", skip_langs) require("nvim-treesitter.install").write_lockfile("verbose", skip_langs)
vim.cmd "q" vim.cmd "q"