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
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

View file

@ -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"