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:
parent
135eabc57c
commit
8267bc2e12
4 changed files with 32 additions and 30 deletions
21
inc/nux-runner.inc.sh
Normal file
21
inc/nux-runner.inc.sh
Normal 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
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue