From 33257650c8b36006be6d9379af4536602feb74e0 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Thu, 9 Mar 2023 17:16:02 +0100 Subject: [PATCH] Fix function detecion Different shells has slightly different output of `type`: $ yash -c "f(){ :; }; type f" f: a function $ dash -c "f(){ :; }; type f" f is a shell function $ zsh -c "f(){ :; }; type f" f is a shell function from zsh Lets only look for the word "function" which seems to be the only common thing. --- lib/tiny-cloud/init-early | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tiny-cloud/init-early b/lib/tiny-cloud/init-early index d85fcaf..141398d 100644 --- a/lib/tiny-cloud/init-early +++ b/lib/tiny-cloud/init-early @@ -32,7 +32,7 @@ install_hotplugs() { for module in $HOTPLUG_MODULES; do result='-' printf " $module" - if type "mod__$module" | grep -q "is a function"; then + if type "mod__$module" | grep -q -w "function"; then "mod__$module" && result='+' || { result='!'; rc=1; } fi printf "($result)"