Skip to content

Commit 8941f81

Browse files
committed
new call function
1 parent d18bf7e commit 8941f81

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

scripts/soda/exec.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,17 @@ execute() {
126126
return 1
127127
fi
128128
}
129+
130+
#
131+
# Calls the given function. Using this method will broadcast events around the call:
132+
#
133+
# ${TASK_NAME}-start: after task call
134+
# ${TASK_NAME}-finish: before task call
135+
#
136+
call() {
137+
local task="$1"
138+
shift
139+
broadcast "${task}-start"
140+
$task $@
141+
broadcast "${task}-finish"
142+
}

soda

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,6 @@ if [[ -n "$task_name" ]]; then
9090
exit 1
9191
}
9292
broadcast "start"
93-
"$TASK" "${SODA_TASK_PARAMETERS[@]:1}"
93+
call "$TASK" "${SODA_TASK_PARAMETERS[@]:1}"
9494
broadcast "finish"
9595
fi

0 commit comments

Comments
 (0)