taskal is a simple and easy task runner.
$ taskal [options...] [tasks ...] -- [optional args ...]
-T Show all tasks.
-c string
taskal -c [CONFIGFILE] (default "taskal.yml")
-n Do a dry run without executing actions.
$ cat taskal.yml
example: echo example
example2: echo example2
$ taskal example
[INFO][15:04:05] Execute task: example
[INFO][15:04:05] sh -c "echo example"
example
It is because you only need to know YAML.
If you are a Golang developper/user; then execute go get.
$ go get -u github.com/masato-hi/taskal
Create taskal.yml in YAML format.
This defines the task whose task name is "build" and whose command is "echo build".
build: echo build
This is add define the task whose task name is "test" and whose command is "echo test".
build: echo build
test: echo test
build: |
if [ ! -e "/tmp/build.lock" ]; then
touch "/tmp/build.lock"
echo build
rm "/tmp/build.lock"
else
exit 2
fi
test: echo test
build:
- echo prepare build
- echo build
- echo clean build
test: &test echo test
build:
- *test
- echo build
Of course, you can depend on tasks that execute multiple commands.
test: &test echo test
prepare: &prepare
- echo do linter
- *test
build:
- *prepare
- echo build
- echo clean build
Definition of hidden tasks
Tasks with an underscore at the starting of the name are not displayed in the task list.
test: &test echo test
_prepare: &prepare
- echo do linter
- *test
build:
- *prepare
- echo build
- echo clean build
$ taskal -T
All defined tasks:
build
test
Pass arguments after double-dash(--
) and refer to $@
.
build: echo build $@
$ taskal build -- additional arguments
[INFO][15:04:05] Execute task: build
[INFO][15:04:05] sh -c "echo build $@" -- additional arguments
build additional arguments