Rationalize config file locations and update documentation
All checks were successful
ci/woodpecker/tag/release Pipeline was successful

This commit is contained in:
2026-05-14 21:02:06 -05:00
parent 4ba8d771e0
commit dc8e1040f2
10 changed files with 217 additions and 21 deletions

View File

@@ -19,7 +19,7 @@ func Plan(ctx context.Context, args []string, out io.Writer) error {
var pipelinePath string
var sessionPath string
var force bool
fs.StringVar(&pipelinePath, "config", "", "path to pipeline.yml")
fs.StringVar(&pipelinePath, "config", "", "path to pipeline.yml (optional; defaults searched)")
fs.StringVar(&sessionPath, "session", "", "path to session.yml")
fs.BoolVar(&force, "force", false, "force stage execution (reserved for future behavior)")
@@ -29,11 +29,16 @@ func Plan(ctx context.Context, args []string, out io.Writer) error {
if fs.NArg() != 0 {
return fmt.Errorf("plan: unexpected positional arguments")
}
if pipelinePath == "" || sessionPath == "" {
return fmt.Errorf("plan: --config and --session are required")
if sessionPath == "" {
return fmt.Errorf("plan: --session is required")
}
cfg, err := config.Load(pipelinePath, sessionPath)
resolvedPipelinePath, err := resolvePipelineConfigPath(pipelinePath)
if err != nil {
return fmt.Errorf("plan: %w", err)
}
cfg, err := config.Load(resolvedPipelinePath, sessionPath)
if err != nil {
return fmt.Errorf("plan: %w", err)
}