mirror of
https://gitlab.alpinelinux.org/alpine/cloud/tiny-cloud.git
synced 2025-12-16 11:52:43 +03:00
Refactor skip_action
micro optimization. No forks used readability improved by avoiding regex.
This commit is contained in:
parent
091af053c5
commit
4ba3ce17bc
@ -19,11 +19,11 @@ bootstrap_incomplete() { rm -f "$TINY_CLOUD_VAR"/.bootstrap-complete ; }
|
|||||||
# should we skip this action?
|
# should we skip this action?
|
||||||
skip_action() {
|
skip_action() {
|
||||||
local action="$1"
|
local action="$1"
|
||||||
|
for i in $SKIP_INIT_ACTIONS; do
|
||||||
# no action? don't skip.
|
if [ "$i" = "$action" ]; then
|
||||||
[ -z "$action" ] && return 1
|
|
||||||
|
|
||||||
# action not in the skip list?
|
|
||||||
echo "$SKIP_INIT_ACTIONS" | grep -Eq "\b$action\b" || return 1
|
|
||||||
printf " SKIPPING"
|
printf " SKIPPING"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
return 1
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user