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"