Skip to content

Commit

Permalink
fix: create output directory before writing normalized transcripts
Browse files Browse the repository at this point in the history
  • Loading branch information
shahruk10 committed Jul 18, 2022
1 parent e5f10a1 commit 33233f5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions internal/score/normalize.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ func normalizeFiles(
ctx context.Context, fileFormat FileFormat, cfg NormalizeConfig,
outDir, refFile string, hypFiles []sctk.Hypothesis,
) (string, []sctk.Hypothesis, error) {
const (
filePerm = 0777
)

if err := os.MkdirAll(outDir, filePerm); err != nil {
return "", nil, fmt.Errorf("failed to create output directory: %w", err)
}

// Read reference transcripts.
refUtts, err := readTranscriptFile(refFile, fileFormat)
if err != nil {
Expand Down

0 comments on commit 33233f5

Please sign in to comment.