]> glassweightruler.freedombox.rocks Git - xdg-ninja.git/commitdiff
Refactor file processing logic in jq command
authorb3nj5m1n <b3nj4m1n@gmx.net>
Sun, 7 Jan 2024 07:35:50 +0000 (08:35 +0100)
committerb3nj5m1n <b3nj4m1n@gmx.net>
Sun, 7 Jan 2024 07:35:50 +0000 (08:35 +0100)
xdg-ninja.sh

index 44a9b3760af54d10395403c82508efb9efacb04d..fc1f1154e848a91d5c85b43bc258c33a786b5994 100755 (executable)
@@ -230,7 +230,7 @@ do_check_programs() {
 " read -r name; read -r filename; read -r movable; read -r help; do
         check_file "$name" "$filename" "$movable" "$help"
     done <<EOF
 " read -r name; read -r filename; read -r movable; read -r help; do
         check_file "$name" "$filename" "$movable" "$help"
     done <<EOF
-$(jq 'if type == "object" then .files[] as $file | .name, $file.path, $file.movable, $file.help else . end' "$XN_PROGRAMS_DIR"/* | sed -e 's/^"//' -e 's/"$//')
+$(jq '.files[] as $file | .name, $file.path, $file.movable, $file.help' "$XN_PROGRAMS_DIR"/* | sed -e 's/^"//' -e 's/"$//')
 EOF
 # sed is to trim quotes
 }
 EOF
 # sed is to trim quotes
 }