Skip to content

Commit

Permalink
fix: when md export need to write overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
cuiko authored and jakezhu9 committed Jan 17, 2024
1 parent 799d116 commit e8f556a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion service/impl/export_import.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ func (e *exportImport) ExportMarkdown(ctx context.Context, needFrontMatter bool)
markdown.WriteString(post.OriginalContent)

fileName := post.CreateTime.Format("2006-01-02") + "-" + post.Slug + ".md"
file, err := os.OpenFile(filepath.Join(backupFilePath, fileName), os.O_WRONLY|os.O_CREATE, 0o666)
file, err := os.OpenFile(filepath.Join(backupFilePath, fileName), os.O_WRONLY|os.O_TRUNC|os.O_CREATE, 0o666)
if err != nil {
return "", xerr.WithStatus(err, xerr.StatusInternalServerError).WithMsg("create file err")
}
Expand Down

0 comments on commit e8f556a

Please sign in to comment.