Add run file example
This commit is contained in:
parent
08e65f606e
commit
6eaeb56a2f
1 changed files with 27 additions and 0 deletions
27
run-file/run
Executable file
27
run-file/run
Executable file
|
|
@ -0,0 +1,27 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# https://github.com/adriancooney/Taskfile
|
||||||
|
# https://nickjanetakis.com/blog/replacing-make-with-a-shell-script-for-running-your-projects-tasks
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
bar() {
|
||||||
|
echo "Running bar..."
|
||||||
|
}
|
||||||
|
|
||||||
|
help() {
|
||||||
|
echo "$0 <task> <args>"
|
||||||
|
echo "Tasks:"
|
||||||
|
compgen -A function | grep -v "^_" | cat -n
|
||||||
|
}
|
||||||
|
|
||||||
|
foo() {
|
||||||
|
echo "Running foo..."
|
||||||
|
}
|
||||||
|
|
||||||
|
_hidden() {
|
||||||
|
echo "This command should be hidden."
|
||||||
|
}
|
||||||
|
|
||||||
|
TIMEFORMAT="Task completed in %3lR"
|
||||||
|
time "${@:-help}"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue