refactor(lockfile): use better jq parsing

This commit is contained in:
kylo252 2022-01-25 12:52:51 +01:00 committed by Stephan Seitz
parent 09bd6b5d7e
commit 1ea964a13c

View file

@ -1,15 +1,14 @@
#!/bin/sh #!/usr/bin/env bash
make_ignored() { make_ignored() {
if [ -n "$1" ] if [ -n "$1" ]
then then
jq keys < lockfile.json | tail --line=+2 | head --lines=-1 | tr -d "\" ," | while read lang while read -r lang; do
do
if [ "$lang" != "$1" ] if [ "$lang" != "$1" ]
then then
printf "$lang," printf "%s," "$lang"
fi fi
done done < <(jq 'keys|@sh' -c lockfile.json)
fi fi
} }