Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue: Data file is not created if it does not exist #621

Closed
davidsneighbour opened this issue Aug 14, 2023 · 1 comment
Closed

Issue: Data file is not created if it does not exist #621

davidsneighbour opened this issue Aug 14, 2023 · 1 comment
Labels

Comments

@davidsneighbour
Copy link
Contributor

Describe the bug
With a new data file configuration there is no error message when I add a new item, but the data file is also not created if it does not exists. The config in .frontmatter/config/data/files/kurzschnitte.json is as follows:

{
  "$schema": "https://frontmatter.codes/config/data.files.schema.json",
	"id": "kurzschnitte",
	"title": "Kurzschnitte",
	"file": "[[workspace]]/data/dnb/kollitsch/kurzschnitte.json",
	"fileType": "json",
	"labelField": "title",
	"singleEntry": false,
	"schema": {
		"title": "Kurzschnitte",
		"type": "object",
		"required": [
			"title",
			"link",
			"slug"
		],
		"properties": {
			"title": {
				"type": "string",
				"title": "Title"
			},
			"link": {
				"type": "string",
				"title": "Link"
			},
			"description": {
				"type": "string",
				"multiline": true,
				"title": "Description"
			},
			"labels": {
				"type": "array",
				"items": {
					"type": "string"
				}
			},
			"slug": {
				"type": "string",
				"title": "Kurzschnitt-Post"
			},
		}
	}
}

Adding a new entry on the Dashboard > Data screen -

  1. If the file [[workspace]]/data/dnb/kollitsch/kurzschnitte.json does not exist then Frontmatter shows a success message but does not add the item in the items column, and also no data file in the configured location

  2. If I create a file in [[workspace]]/data/dnb/kollitsch/kurzschnitte.json with an empty JSON content ({}) then it works as expected.

I would expect Frontmatter to have enough rights to create the file (file rights on the folder are checked and belong to the user opening VSCode) or at least fail or convey the failing properly.

Desktop (please complete the following information):

  • OS: Ubuntu 22.04 LTS
  • Browser: Chrome latest
@davidsneighbour davidsneighbour added the bug Something isn't working label Aug 14, 2023
@estruyf
Copy link
Owner

estruyf commented Aug 20, 2023

Thanks @davidsneighbour; this has been fixed in the latest beta.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants