From 8d3176cfbc0e3c5b8eadf4dfc20681878529c3af Mon Sep 17 00:00:00 2001 From: ObserverOfTime Date: Mon, 11 Mar 2024 18:58:08 +0200 Subject: fix(scripts): actually skip lockfile updates --- scripts/update-lockfile.sh | 16 +++++++--------- scripts/write-lockfile.lua | 1 - 2 files changed, 7 insertions(+), 10 deletions(-) (limited to 'scripts') 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" -- cgit v1.2.3-70-g09d2