Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Lazy

The lazy setting1.47.0 causes the evaluator to skip evaluating unused variables. This can be beneficial when a justfile contains variables that are expensive to evaluate but only sometimes used.

In the following justfile, token will be skipped when only invoking bar:

set lazy

token := `expensive-script-to-get-credentials`

foo:
  curl -H "Authorization: Bearer {{ token }}" https://example.com/foo

bar:
  cargo test

Because just cannot determine when exported variables are used, assignments with export and assignments in a module with set export will always be evaluated.