Enforce requested adapter output paths
This commit is contained in:
@@ -133,17 +133,17 @@ func (mergeStage) Run(ctx context.Context, env *Env, m *manifest.Manifest) (*Sta
|
||||
return nil, fmt.Errorf("merge: seriatim merge failed: %w", err)
|
||||
}
|
||||
|
||||
finalMergedPath := mergedPath
|
||||
if strings.TrimSpace(res.MergedTranscriptPath) != "" {
|
||||
finalMergedPath = res.MergedTranscriptPath
|
||||
finalMergedPath, err := authoritativeOutputPath(mergedPath, res.MergedTranscriptPath)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("merge: %w", err)
|
||||
}
|
||||
if err := validateTranscriptJSONFile(finalMergedPath); err != nil {
|
||||
return nil, fmt.Errorf("merge: merged transcript %q invalid: %w", finalMergedPath, err)
|
||||
}
|
||||
|
||||
finalReportPath := req.ReportPath
|
||||
if strings.TrimSpace(res.ReportPath) != "" {
|
||||
finalReportPath = res.ReportPath
|
||||
finalReportPath, err := authoritativeOutputPath(req.ReportPath, res.ReportPath)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("merge: %w", err)
|
||||
}
|
||||
if reportEnabled {
|
||||
if err := validateTranscriptJSONFile(finalReportPath); err != nil {
|
||||
@@ -290,9 +290,9 @@ func normalizeMergeInputs(
|
||||
return nil, nil, nil, nil, fmt.Errorf("merge: normalize input %q failed: %w", input, err)
|
||||
}
|
||||
|
||||
finalOutputPath := outPath
|
||||
if strings.TrimSpace(res.OutputNormalizedPath) != "" {
|
||||
finalOutputPath = strings.TrimSpace(res.OutputNormalizedPath)
|
||||
finalOutputPath, err := authoritativeOutputPath(outPath, res.OutputNormalizedPath)
|
||||
if err != nil {
|
||||
return nil, nil, nil, nil, fmt.Errorf("merge: normalize input %q: %w", input, err)
|
||||
}
|
||||
if err := validateTranscriptJSONFile(finalOutputPath); err != nil {
|
||||
return nil, nil, nil, nil, fmt.Errorf("merge: normalized transcript %q invalid (input %q): %w", finalOutputPath, input, err)
|
||||
|
||||
Reference in New Issue
Block a user