1
1
Fork 0
mirror of https://github.com/tonydamage/nux-env.git synced 2025-12-11 13:24:28 +01:00
nux-env/inc/nux-runner.inc.sh
Tony Tkacik 8267bc2e12 Moved is_function and runner.run to inc/
Signed-off-by: Tony Tkacik <tonydamage@gmail.com>
2016-11-11 20:09:30 +01:00

21 lines
588 B
Bash

nux-runner.run() {
TASK=$1; shift; # Determines task
if nux.check.function task.$TASK ; then
nux.log debug "Running task: $TASK";
task.$TASK "$@" # Runs task
else
nux.log debug "Including script: $NUX_SCRIPT"
source $NUX_SCRIPT; # Includes script
if nux.check.function task.$TASK ; then
nux.log debug "Running task: $TASK";
task.$TASK "$@" # Runs task
else
echo "$NUX_SCRIPTNAME: Unrecognized task ''$TASK' not available."
echo "Try '$NUX_SCRIPTNAME help' for more information."
exit -1
fi
fi
}