Merge pull request 'feat: Add last newline on markdown file' (#1) from newlines into main

Reviewed-on: https://git.weko.io/resilien/directus-to-markdown/pulls/1
This commit is contained in:
Simon 2022-01-28 00:18:39 +01:00
commit e527a71708
3 changed files with 4 additions and 4 deletions

View File

@ -21,7 +21,7 @@ export default class DirectusToMarkdown {
async _writeIndex(item, itemPath) { async _writeIndex(item, itemPath) {
const frontMatter = this._formatFrontMatter(item) const frontMatter = this._formatFrontMatter(item)
const content = item[this.contentKey] ? item[this.contentKey].toString() : '' const content = item[this.contentKey] ? item[this.contentKey].toString() : ''
const itemContent = `${frontMatter}${content}` const itemContent = `${frontMatter}${content}\r\n`
const indexName = 'index' // TODO: index or _index ? const indexName = 'index' // TODO: index or _index ?
fs.writeFileSync(`${itemPath}/${indexName}.md`, itemContent) fs.writeFileSync(`${itemPath}/${indexName}.md`, itemContent)
} }

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "@resilien/directus-to-markdown", "name": "@resilien/directus-to-markdown",
"version": "1.0.0", "version": "0.2.0",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@resilien/directus-to-markdown", "name": "@resilien/directus-to-markdown",
"version": "1.0.0", "version": "0.2.0",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"@directus/sdk": "^9.5.0", "@directus/sdk": "^9.5.0",

View File

@ -1,6 +1,6 @@
{ {
"name": "@resilien/directus-to-markdown", "name": "@resilien/directus-to-markdown",
"version": "0.1.0", "version": "0.2.0",
"description": "Export Directus items to markdown files with assets", "description": "Export Directus items to markdown files with assets",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {