From 353e4c4f488f2c7233e13c67078035324d494c20 Mon Sep 17 00:00:00 2001 From: Andrey Nering Date: Wed, 17 May 2017 14:42:23 -0300 Subject: [PATCH] README: Add documentation for status --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 1e520b1f..ee3005b3 100644 --- a/README.md +++ b/README.md @@ -199,6 +199,22 @@ will compare the modification date/time of the files to determine if it's necessary to run the task. If not, it will just print `Task "js" is up to date`. +Alternatively, you can inform a sequence of tests as `status`. If no error +is returned (exit status 0), the task is considered up-to-date: + +```yml +generate-files: + cmds: + - mkdir directory + - touch directory/file1.txt + - touch directory/file2.txt + # test existence of files + status: + - test -d directory + - test -f directory/file1.txt + - test -f directory/file2.txt +``` + You can use `--force` or `-f` if you want to force a task to run even when up-to-date.