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 1737416a72 nux-runner: Added support ti be included as source.
Signed-off-by: Tony Tkacik <atkacik@brocade.com>
2016-12-01 16:17:33 +01:00

24 lines
645 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
if [ -z "$NUX_NO_INCLUDE" ]
then
nux.log debug "Including script: $NUX_SCRIPT"
source $NUX_SCRIPT; # Includes script
fi
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
}