mirror of
https://gitlab.alpinelinux.org/alpine/cloud/tiny-cloud.git
synced 2025-12-16 03:42:44 +03:00
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.
This commit is contained in:
parent
e9b4350617
commit
33257650c8
@ -32,7 +32,7 @@ install_hotplugs() {
|
|||||||
for module in $HOTPLUG_MODULES; do
|
for module in $HOTPLUG_MODULES; do
|
||||||
result='-'
|
result='-'
|
||||||
printf " $module"
|
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; }
|
"mod__$module" && result='+' || { result='!'; rc=1; }
|
||||||
fi
|
fi
|
||||||
printf "($result)"
|
printf "($result)"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user