Simple, lightweight, self-documented task runner for POSIX Shell. Compatible with ash, bash, dash, Linux, Mac OS, alpine, docker.
You could create shell script e.g. run
in your project with code:
task_hello() { ## Print Hello World box
_box --p=1 --bg-green --bold --white "Hello World! $(_ansi --blue "🌍")"
}
url="https://raw.githubusercontent.com/webuni/shell-task-runner/master/run"
if [ -n "$(command -v 'wget')" ]; then eval "$(wget -qO- "$url")"; else eval "$(curl -s "$url")"; fi
And then you just have to run this file sh ./run
.
-
_align
-
_ansi
-
_box
-
_doc_comment
-
_doc_title
-
_docker_run
-
_dotenv
-
_header: Application header.
-
_indent
-
_log
-
_quote
-
_printf_escape
-
_shell_escape
-
_tasks: List of functions with prefix
task_
.
-
_fail
-
_pass
If you want to replace a helper functions, you should import runner script and then implement helper function.
At the end of the file, you must explicitly call _run
:
url="https://raw.githubusercontent.com/webuni/shell-task-runner/master/run"
if [ -n "$(command -v 'wget')" ]; then eval "$(wget -qO- "$url")"; else eval "$(curl -s "$url")"; fi
_header()(
printf '%s\n\n' "$(_ansi --bold "My application")"
)
_run "$@"