1
1
Fork 0
mirror of https://github.com/tonydamage/nux-env.git synced 2025-12-11 13:24:28 +01:00

Moved is_function and runner.run to inc/

Signed-off-by: Tony Tkacik <tonydamage@gmail.com>
This commit is contained in:
Tony Tkáčik 2016-11-11 20:09:30 +01:00
parent 135eabc57c
commit 8267bc2e12
4 changed files with 32 additions and 30 deletions

21
inc/nux-runner.inc.sh Normal file
View file

@ -0,0 +1,21 @@
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
}