Skip to content

Commit

Permalink
fix(gatsby-tinacms-json): JsonCreator commits files after writing
Browse files Browse the repository at this point in the history
  • Loading branch information
ncphillips committed Oct 8, 2020
1 parent 8a078b4 commit a252c13
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/gatsby-tinacms-json/src/create-json-plugin.ts
Expand Up @@ -64,9 +64,14 @@ export class JsonCreatorPlugin<FormShape = any, FrontmatterShape = any>
const fileRelativePath = await this.filename(form)
const content = await this.data(form)

cms.api.git!.onChange!({
await cms.api.git!.onChange!({
fileRelativePath,
content: JSON.stringify(content, null, 2),
})

await cms.api.git.commit({
files: [fileRelativePath],
message: `Commit from Tina: Created ${fileRelativePath}`,
})
}
}

0 comments on commit a252c13

Please sign in to comment.