invoke_task.ts

Declarations
#

view source

invoke_task
#

invoke_task.ts view source

(task_name: RawInputPath, args: Args | undefined, config: GroConfig, initial_filer?: Filer | undefined, initial_timings?: Timings | null | undefined, parent_log?: Logger | undefined): Promise<...>

Invokes Gro tasks by name using the filesystem as the source.

When a task is invoked, Gro first searches for tasks in the current working directory. and falls back to searching Gro's directory, if the two are different. See src/lib/input_path.ts for info about what "task_name" can refer to. If it matches a directory, all of the tasks within it are logged, both in the current working directory and Gro.

This code is particularly hairy because we're accepting a wide range of user input and trying to do the right thing. Precise error messages are especially difficult and there are some subtle differences in the complex logical branches. The comments describe each condition.

task_name

- The name of the task to invoke.

args

- The CLI args to pass to the task.

type Args | undefined

config

- The Gro configuration.

initial_filer?

type Filer | undefined
optional

initial_timings?

- The timings to use for the top-level task, null for composed tasks.

type Timings | null | undefined
optional

parent_log?

type Logger | undefined
optional

returns

Promise<void>

Depends on
#

Imported by
#