diff options
Diffstat (limited to 'scripts/update-lockfile.sh')
| -rwxr-xr-x | scripts/update-lockfile.sh | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/scripts/update-lockfile.sh b/scripts/update-lockfile.sh index 22460d14b..d950b321a 100755 --- a/scripts/update-lockfile.sh +++ b/scripts/update-lockfile.sh @@ -1,18 +1,20 @@ #!/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 -r 'keys[]' lockfile.json) + done < <(jq 'keys|@sh' -c lockfile.json) fi } -SKIP_LOCKFILE_UPDATE_FOR_LANGS="$(make_ignored "$1")" \ - nvim --headless -c 'luafile ./scripts/write-lockfile.lua' +q +TO_IGNORE=$(make_ignored $1) +SKIP_LOCKFILE_UPDATE_FOR_LANGS="$TO_IGNORE" nvim -l ./scripts/write-lockfile.lua # Pretty print cp lockfile.json /tmp/lockfile.json -jq --sort-keys > lockfile.json < /tmp/lockfile.json +cat /tmp/lockfile.json | jq --sort-keys > lockfile.json |
