From ebec70a7dcaf6bd98bdd8544457cd51f10974f92 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Sat, 13 Sep 2025 21:55:31 +0100 Subject: [PATCH] Return early if the location is unknown --- modules/hosts/t480/dwm/dwmblocks/weather.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/hosts/t480/dwm/dwmblocks/weather.nix b/modules/hosts/t480/dwm/dwmblocks/weather.nix index 2002481a..84d3aee3 100644 --- a/modules/hosts/t480/dwm/dwmblocks/weather.nix +++ b/modules/hosts/t480/dwm/dwmblocks/weather.nix @@ -9,7 +9,11 @@ runtimeInputs = with pkgs; [ curl ]; text = '' - curl -s https://wttr.in/Caerleon?format=%t + out="$(curl -s https://wttr.in/Caerleon?format=%t)" + + [[ "$out" == *"Unknown location"* ]] && exit 1 + + echo "$out" ''; }) ];