Skip to content

Commit

Permalink
fix: codeSamples no output path fix (#1079)
Browse files Browse the repository at this point in the history
There's a bug currently when codeSamples `output` is unset but the
target's `output` IS set. This causes codesamples to fail because it
tries to write the output to target.output, which is always a directory
  • Loading branch information
chase-crumbaugh authored Nov 7, 2024
1 parent 6f6b891 commit 35acae8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/run/target.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,9 @@ func (w *Workflow) runTarget(ctx context.Context, target string) (*SourceResult,
func (w *Workflow) runCodeSamples(ctx context.Context, codeSamplesStep *workflowTracking.WorkflowStep, codeSamples workflow.CodeSamples, target, sourcePath string, baseOutputPath *string) (string, string, error) {
configPath := "."
outputPath := codeSamples.Output
if baseOutputPath != nil {

// If an output path is specified, make sure it's relative to the base output path
if baseOutputPath != nil && outputPath != "" {
configPath = *baseOutputPath
outputPath = filepath.Join(*baseOutputPath, outputPath)
}
Expand Down

0 comments on commit 35acae8

Please sign in to comment.