Skip to content

Unify conditions: Shell, Resource, All/Any/Not, remove DependsOn - #29

Merged
TsekNet merged 1 commit into
mainfrom
unified-conditions
Apr 13, 2026
Merged

TsekNet merged 1 commit into
mainfrom
unified-conditions

Conversation

@TsekNet

@TsekNet TsekNet commented Apr 12, 2026

Copy link
Copy Markdown
Owner

Summary

One way to express dependencies and guards: the Condition field on Meta.

condition.Shell("pgrep nginx")                                    // exit 0 = met
condition.Shell("cat /etc/hostname").Match("web01")               // output match
condition.Shell("Get-Feature ...").In("pwsh").Match("Enabled")    // explicit shell
condition.Resource("package:nginx")                               // DAG dependency
condition.All(condition.Resource("pkg:nginx"), condition.FileExists("/etc/nginx"))
condition.Not(condition.Shell("pgrep legacy"))

Test plan

  • go build ./... passes (Linux, macOS, Windows)
  • go test -race ./... passes
  • go vet ./... clean

Closes #28

@TsekNet
TsekNet force-pushed the unified-conditions branch 2 times, most recently from 0eb7345 to 98e69d5 Compare April 13, 2026 00:24
Add condition.Shell with .In() and .Match() builder pattern.
Add condition.Resource, All, Any, Not combinators. Extract shared
shell resolution into internal/shell.

Remove OnlyIf/OnlyIfMatch from Exec (use condition.Shell on Condition).
Remove DependsOn from Meta (use condition.Resource on Condition).
Flatten Meta fields directly into every Opts struct (no embedding).

Closes #28
@TsekNet
TsekNet force-pushed the unified-conditions branch from 98e69d5 to c882b66 Compare April 13, 2026 00:33
@TsekNet
TsekNet merged commit 46059ac into main Apr 13, 2026
2 checks passed
@TsekNet
TsekNet deleted the unified-conditions branch April 13, 2026 02:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unify conditions: condition.Shell, condition.Resource, combinators, remove DependsOn

1 participant