diff options
| author | ewy <ewy0@protonmail.com> | 2026-04-22 22:19:34 +0200 |
|---|---|---|
| committer | ewy <ewy0@protonmail.com> | 2026-04-22 22:19:34 +0200 |
| commit | 068d5a6b0554a5d215f2910f3145d3628ff54f53 (patch) | |
| tree | 1a0ad6efee7902e1bb493fde53b71045023f6fe6 /run | |
| parent | 1e8cedca4d03829fadd532e9c5980dbb0eeab4bb (diff) | |
docs
Diffstat (limited to 'run')
| -rw-r--r-- | run/run.go | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -10,6 +10,11 @@ import ( "slices" ) +// Run creates an exec.Cmd from a model.Source, model.Target and args. +// 1. run pre-triggers, quit on fail +// 2. run target +// 3. if success, run post +// 4. run final func Run(source *model.Source, target model.Target, args ...string) error { tags := target.Tags() skipTriggers := tags.Has(model.Single) || *flags.Single @@ -50,6 +55,8 @@ func Final(source *model.Source, target model.Target) error { return ExecWithTrigger(source, target, model.Final) } +// ExecWithTrigger loops through a model.Source and runs targets if they match the expected model.Tag +// triggers only run if their subdirectory is "in tree" func ExecWithTrigger(source *model.Source, target model.Target, tag model.Tag) error { for _, t := range source.Targets { if t.Tags().Has(tag) { |
