From 640159454825839bd6f281b9f912d6db06f9bf24 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Wed, 6 Apr 2022 22:22:13 +0100 Subject: [PATCH] build(run): prefix tasks with a `task:` namespace https://github.com/adriancooney/Taskfile/tree/c949650a80ccf42472948056d44e7e6f5b584a5b#task-namespace --- run | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/run b/run index 869e32c..bc4118d 100755 --- a/run +++ b/run @@ -8,20 +8,20 @@ set -e APP_BUILD="${APP_BUILD:=dynamic}" DOCKER_TAG=meetup-raffle-winner-picker -function build { +function task:build { # Build the Docker image. docker image build . --tag ${DOCKER_TAG} } -function ci:test { +function task:ci:test { # Run continuous integration (CI) checks. APP_BUILD=static - build - test --testdox "${@}" + task:build + task:test --testdox "${@}" } -function composer { +function task:composer { # Run Composer commands. docker container run --rm -it \ -v $(pwd):/app \ @@ -29,22 +29,22 @@ function composer { ${DOCKER_TAG} "${@}" } -function console { +function task:console { docker container run --rm -t \ --entrypoint php \ ${DOCKER_TAG} \ bin/console ${@} } -function help { +function task:help { printf "%s [args]\n\nTasks:\n" "${0}" - compgen -A function | grep -v "^_" | cat -n + compgen -A function | sed -En 's/task:(.*)/\1/p' | cat -n printf "\nExtended help:\n Each task has comments for general usage\n" } -function test { +function task:test { # Run PHPUnit tests. if [[ $APP_BUILD == "dynamic" ]]; then docker container run --rm -t -v $PWD:/app --entrypoint phpunit ${DOCKER_TAG} "${@}" @@ -53,4 +53,4 @@ function test { fi } -eval "${@:-help}" +eval "task:${@:-help}"