You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I want to be able to skip a task if the codebase does not meet the given criteria at the execution time. For example, in Go, one might want to create a task that executes go generate. The output files are known and should be defined. What's unknown is whether the given project has any //go:generate annotation in its codebase.
This task will produce error if run against Go project without any //go:generate templ generate ./... annotation:
Error: task_runner::missing_outputs
× Task foo-bar:generate defines outputs but after being ran, either none or not all of them exist.
│ If you require optional outputs, try using glob patterns instead.
Describe the solution you'd like
Having additional property condition in the Task schema. Value of this field could a simple bash script.
Bash
tasks:
generate:
condition: | if output=$(go generate -n ./... 2>&1 1>/dev/null); then if [[ -n "$output" ]]; then exit 1 else exit 0 fi ficommand: 'go generate ./...'inputs:
- '**/*.go'
- 'go.mod'
- '/go.mod'outputs:
- '**/*.pb.go'
- '**/*_templ.go'
Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
I want to be able to skip a task if the codebase does not meet the given criteria at the execution time. For example, in Go, one might want to create a task that executes
go generate
. Theoutput
files are known and should be defined. What's unknown is whether the given project has any//go:generate
annotation in its codebase.This task will produce error if run against Go project without any
//go:generate templ generate ./...
annotation:Describe the solution you'd like
Having additional property
condition
in the Task schema. Value of this field could a simple bash script.Bash
Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered: