From 3f0ccc24e00bab47c180bd772a27d31b774b2a68 Mon Sep 17 00:00:00 2001 From: Soispha Date: Wed, 28 Feb 2024 21:11:00 +0100 Subject: fix(hm/conf/zsh/command_not_found.sh): Correctly count found attrs --- hm/soispha/conf/zsh/config/command_not_found.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hm/soispha/conf/zsh/config/command_not_found.sh b/hm/soispha/conf/zsh/config/command_not_found.sh index ae6de636..f3339451 100644 --- a/hm/soispha/conf/zsh/config/command_not_found.sh +++ b/hm/soispha/conf/zsh/config/command_not_found.sh @@ -17,7 +17,7 @@ command_not_found_handle() { toplevel=nixpkgs # nixpkgs should always be available even in NixOS cmd="$1" attrs=$(nix-locate --minimal --no-group --type x --type s --top-level --whole-name --at-root "/bin/$cmd") - len=$(echo "$attrs" | wc -l) + len=$(if [ -n "$attrs" ]; then echo "$attrs" | wc -l; else echo 0; fi) case "$len" in 0) -- cgit 1.4.1