about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2024-02-28 21:11:00 +0100
committerSoispha <soispha@vhack.eu>2024-02-28 21:11:00 +0100
commit3f0ccc24e00bab47c180bd772a27d31b774b2a68 (patch)
tree70de13db0e9f2204db0e40e6456fbd6d6f80d5e0
parentfix(hm/conf/zsh): Add a newline to the shell library import (diff)
downloadnixos-config-3f0ccc24e00bab47c180bd772a27d31b774b2a68.tar.gz
nixos-config-3f0ccc24e00bab47c180bd772a27d31b774b2a68.zip
fix(hm/conf/zsh/command_not_found.sh): Correctly count found attrs
Diffstat (limited to '')
-rw-r--r--hm/soispha/conf/zsh/config/command_not_found.sh2
1 files changed, 1 insertions, 1 deletions
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)