From 9948bc22643deb2d4a5c72b0cb7dcfd03197ef47 Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Sun, 30 Oct 2022 11:25:52 +0100 Subject: [PATCH] completions/apt: Add quotes Simple way to make the apt completions spew: function apt; end on a system without an apt command installed. (even if it isn't Darwin, because this uses test combiners!) This is a thing some people do to avoid learning other package managers. (of course our completions would probably be *wrong* still, but at least they won't spew a `test` error) --- share/completions/apt.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/completions/apt.fish b/share/completions/apt.fish index 39aadc0b1..9a2d89c54 100644 --- a/share/completions/apt.fish +++ b/share/completions/apt.fish @@ -2,7 +2,7 @@ # macOS has a /usr/bin/apt that is something else entirely: # (apt - Returns the path to a Java home directory from the current user's settings) -if [ (uname -s) = Darwin -a (command -v apt) = /usr/bin/apt ] +if [ "$(uname -s)" = Darwin -a "$(command -s apt)" = /usr/bin/apt ] exit 1 end