summaryrefslogtreecommitdiff
path: root/run
diff options
context:
space:
mode:
authorewy <ewy0@protonmail.com>2026-04-22 22:19:34 +0200
committerewy <ewy0@protonmail.com>2026-04-22 22:19:34 +0200
commit068d5a6b0554a5d215f2910f3145d3628ff54f53 (patch)
tree1a0ad6efee7902e1bb493fde53b71045023f6fe6 /run
parent1e8cedca4d03829fadd532e9c5980dbb0eeab4bb (diff)
docs
Diffstat (limited to 'run')
-rw-r--r--run/run.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/run/run.go b/run/run.go
index d175823..efbd01b 100644
--- a/run/run.go
+++ b/run/run.go
@@ -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) {