From 30fee97f735071216970c19c6d494f02e0b91ac5 Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Sat, 3 Oct 2020 14:23:51 -0700 Subject: [PATCH] Document how to ignore errors with `-` in readme (#690) --- .github/workflows/build.yaml | 2 +- README.adoc | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index c1ddedd..6a830e0 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -14,7 +14,7 @@ env: # Increment to invalidate github actions caches if they become corrupt. # Errors of the form "can't find crate for `snafu_derive` which `snafu` depends on" # can usually be fixed by incrementing this value. - CACHE_KEY_PREFIX: 2 + CACHE_KEY_PREFIX: 3 jobs: all: diff --git a/README.adoc b/README.adoc index 111b78e..76a715e 100644 --- a/README.adoc +++ b/README.adoc @@ -437,6 +437,26 @@ string! " ``` +=== Ignoring Errors + +Normally, if a command returns a nonzero exit status, execution will stop. To +continue execution after a command, even if it fails, prefix the command with +`-`: + +```make +foo: + cat foo + echo 'Done!' +``` + +```sh +$ just foo +cat foo +cat: foo: No such file or directory +echo 'Done!' +Done! +``` + === Functions Just provides a few built-in functions that might be useful when writing recipes.