From a38c2e344f043ff8db63a643ead04c810df5bbe3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torjus=20H=C3=A5kestad?= Date: Sat, 6 Jul 2024 17:05:10 +0200 Subject: [PATCH] More flakestat improvements --- home/hyprland/waybar/flakestat.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/home/hyprland/waybar/flakestat.sh b/home/hyprland/waybar/flakestat.sh index 1ffcb3c..e4c0a93 100644 --- a/home/hyprland/waybar/flakestat.sh +++ b/home/hyprland/waybar/flakestat.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash +set -eo pipefail # Args: # $1 text @@ -38,9 +39,14 @@ unstable_rev=$(echo "$flake_metadata" | jq -r ".locks.nodes.$unstable_input.lock unstable_branch=$(echo "$flake_metadata" | jq -r ".locks.nodes.$unstable_input.original.ref") cd "$NIXPKGS_DIR" || print_output "?" "Could not find git repo dir" 1 -git fetch -q --all +if ! git fetch -q --all; then + print_output "?" "Unable to fetch commits" 1 + exit 1 +fi + if ! unstable_commit_count=$(git rev-list --count "$unstable_rev..origin/$unstable_branch"); then print_output "?" "Unable to list commits" 1 + exit 1 fi text="$unstable_commit_count"