Skip to content

Commit

Permalink
Rename exportRun and add better file naming
Browse files Browse the repository at this point in the history
Signed-off-by: John Kjell <[email protected]>
  • Loading branch information
jkjell committed Feb 5, 2024
1 parent 838aec6 commit f8d862f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func runRun(ctx context.Context, ro options.RunOptions, args []string, signers .
roHashes = append(roHashes, cryptoutil.DigestValue{Hash: hash, GitOID: false})
}

results, err := witness.ExportedRun(
results, err := witness.RunWithExports(
ro.StepName,
signers[0],
witness.RunWithAttestors(attestors),
Expand All @@ -136,7 +136,14 @@ func runRun(ctx context.Context, ro options.RunOptions, args []string, signers .
return fmt.Errorf("failed to marshal envelope: %w", err)
}

out, err := loadOutfile(ro.OutFilePath + result.AttestorName + ".json")
// TODO: Find out explicit way to describe "prefix" in CLI options
outfile := ro.OutFilePath
if result.AttestorName != "" {
outfile += "-" + result.AttestorName
}
outfile += ".json"

out, err := loadOutfile(outfile)
if err != nil {
return fmt.Errorf("failed to open out file: %w", err)
}
Expand Down

0 comments on commit f8d862f

Please sign in to comment.