From e0d48ae08a993ea438aed9f4fad6d95f54c517be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Sun, 15 Dec 2024 21:05:23 +0100 Subject: [PATCH] fix(create-report): do not error if an output is missing Handle it with grace c: --- create-report.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/create-report.sh b/create-report.sh index 0b01a50..05f5ae5 100755 --- a/create-report.sh +++ b/create-report.sh @@ -5,14 +5,14 @@ set -eu echo 'Retrieving Flake information' >&2 flake_info=$(nix flake show --json 2>/dev/null) packages=$( - jq --raw-output '.packages."x86_64-linux" | keys[]' <<-EOF + jq --raw-output '.packages."x86_64-linux" | select(. != null) | keys[]' <<-EOF $flake_info EOF ) echo "Packages:" >&2 echo "$packages" >&2 configurations=$( - jq --raw-output '.nixosConfigurations | keys[]' <<-EOF + jq --raw-output '.nixosConfigurations | select(. != null) | keys[]' <<-EOF $flake_info EOF ) @@ -67,4 +67,4 @@ markdown() { EOF } -markdown > size-report.md +markdown >size-report.md