fix(create-report): do not error if an output is missing

Handle it with grace c:
This commit is contained in:
Jalil David Salamé Messina 2024-12-15 21:05:23 +01:00
parent 6e8072a14d
commit e0d48ae08a
Signed by: jalil
GPG key ID: F016B9E770737A0B

View file

@ -5,14 +5,14 @@ set -eu
echo 'Retrieving Flake information' >&2 echo 'Retrieving Flake information' >&2
flake_info=$(nix flake show --json 2>/dev/null) flake_info=$(nix flake show --json 2>/dev/null)
packages=$( packages=$(
jq --raw-output '.packages."x86_64-linux" | keys[]' <<-EOF jq --raw-output '.packages."x86_64-linux" | select(. != null) | keys[]' <<-EOF
$flake_info $flake_info
EOF EOF
) )
echo "Packages:" >&2 echo "Packages:" >&2
echo "$packages" >&2 echo "$packages" >&2
configurations=$( configurations=$(
jq --raw-output '.nixosConfigurations | keys[]' <<-EOF jq --raw-output '.nixosConfigurations | select(. != null) | keys[]' <<-EOF
$flake_info $flake_info
EOF EOF
) )