Skip to content

Commit

Permalink
chore(cmd): Return an empty string on error
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Jul 29, 2024
1 parent 70b1829 commit 628b76e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,26 +217,26 @@ func templateReader(conf *config.Config, path string, r io.Reader, size int64) (
if errors.Is(err, io.EOF) {
break
}
return buf.String(), err
return "", err
}

if buf.Len() > 0 {
buf.WriteString("---\n")
}

if err := v.Run(&n); err != nil {
return buf.String(), err
return "", err
}

encoder := yaml.NewEncoder(&buf)
encoder.SetIndent(conf.Indent)
if err := encoder.Encode(&n); err != nil {
_ = encoder.Close()
return buf.String(), err
return "", err
}

if err := encoder.Close(); err != nil {
return buf.String(), err
return "", err
}
}

Expand Down

0 comments on commit 628b76e

Please sign in to comment.