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

Definitions

Environment

State of your computer from which commands are executed.

  • consists of the name of your current directory, your current user, its permissions, the variables accessible to it and the commands it can run at the moment.

Environment variable

A variable that can be read by executables and CJTaskrunner.

Runtime variable

A variable whose value can be read only by CJTaskrunner inside of a task.

  • Set in a task using the @set directive.
  • Accessible only in CJTaskrunner.
  • Lasts the duration of the task context and is passed to subordinate tasks as a snapshot.
  • Will override other variables with the same name for the duration of the task. Most recent definition wins.
  • Can be promoted to an exported variable.

Exported variable

A variable that has the same properties of an environment variable but originated as a runtime variable.

Task context

The environment that spans the execution of a single task.

  • This is the narrowest and most isolated context.
  • It starts as a copy of the taskfile execution context from which the task is run.
  • A copy of it is propagated to subordinate task runs using @task and @await.
  • Unexported variable changes are discarded when the task ends, as well as working directory changes.

Taskfile execution context

the environment that exists from the moment you run a CJTaskrunner task until it finishes.

Variable

A named container holding a value.

  • You refer to a variable by its name, such as MR_VAR.
  • Variables are further divided into runtime variables, environment variables, and exported variables.
  • The name must consist of ascii letters, digits or an underscore. It cannot start with a digit.
  • If you put a $ in front of the variable name, CJTaskrunner will exchange the whole thing for the variable’s value. This is what is called “interpolating” or “dereferencing”.