mirror of
https://github.com/tonydamage/nux-env.git
synced 2025-12-11 13:24:28 +01:00
Added nux-runner script to provide common functionality
This commit is contained in:
parent
4782e60876
commit
bd4c42d40d
1 changed files with 26 additions and 0 deletions
26
bin/nux-runner
Executable file
26
bin/nux-runner
Executable file
|
|
@ -0,0 +1,26 @@
|
|||
#!/bin/bash
|
||||
|
||||
##
|
||||
## help - Shows this help
|
||||
##
|
||||
task_help() {
|
||||
SCRIPTNAME=$(basename $NUX_SCRIPT)
|
||||
echo Usage $SCRIPTNAME [task] [options]
|
||||
|
||||
grep "^\#\#\#" $NUX_SCRIPT | cut -d\# -f4-
|
||||
|
||||
grep "^\#\# " $NUX_SCRIPT | cut -d\# -f3-
|
||||
|
||||
echo
|
||||
echo " help - Shows this help"
|
||||
echo
|
||||
}
|
||||
|
||||
task_() {
|
||||
task_help
|
||||
}
|
||||
|
||||
NUX_SCRIPT=$1; shift; # Determines script
|
||||
TASK=$1; shift; # Determines task
|
||||
source $NUX_SCRIPT; # Includes script
|
||||
task_$task "$*" # Runs task
|
||||
Loading…
Add table
Add a link
Reference in a new issue