Preflight batch output destinations
This commit is contained in:
@@ -334,20 +334,19 @@ func RunBatchDetailed(ctx context.Context, req BatchRequest) (*BatchResult, erro
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := prepareBatchOutputs(req.OutputDir, plannedReports); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if req.Batch == BatchEvening || req.Batch == BatchMorning {
|
||||
startedAt := now
|
||||
result := &BatchResult{Batch: req.Batch, StartedAt: startedAt}
|
||||
for _, planned := range plannedReports {
|
||||
resolved := planned.Resolved
|
||||
item := batchReportResult(planned)
|
||||
outputPath, err := plannedBatchOutputPath(req.OutputDir, planned)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
reportResult, err := generatePromptReport(ctx, promptReportRequest{
|
||||
GenerateRequest: GenerateRequest{
|
||||
Config: req.Config,
|
||||
OutputPath: outputPath,
|
||||
OutputPath: planned.OutputPath,
|
||||
Notifier: req.Notifier,
|
||||
Executor: req.Executor,
|
||||
},
|
||||
@@ -451,6 +450,17 @@ func plannedBatchOutputPath(outputDir string, planned plannedBatchReport) (strin
|
||||
return validateOutputPath(filepath.Join(outputDir, outputName))
|
||||
}
|
||||
|
||||
func prepareBatchOutputs(outputDir string, plannedReports []plannedBatchReport) error {
|
||||
for index := range plannedReports {
|
||||
outputPath, err := plannedBatchOutputPath(outputDir, plannedReports[index])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
plannedReports[index].OutputPath = outputPath
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func resolveReportOutputPath(workingDir, override string, resolved report.Resolved) (string, error) {
|
||||
outputName, err := resolved.OutputName()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user