diff --git a/Upload2Notion.ts b/Upload2Notion.ts index 5f56772..f40dfee 100644 --- a/Upload2Notion.ts +++ b/Upload2Notion.ts @@ -121,10 +121,14 @@ export class Upload2Notion { // if __content have start \n remove it const __content_remove_n = __content.replace(/^\n/, '') const content = '---\n' +yamlhead_remove_n +'\n---\n' + __content_remove_n; - const fullPath = this.getFilePath(nowFile); + // const fullPath = this.getFilePath(nowFile); //write content fo file - fs.writeFileSync(fullPath, content); - console.log(res) + // fs.writeFileSync(fullPath, content); + try { + await nowFile.vault.modify(nowFile, content) + } catch (error) { + new Notice(`write file error ${error}`) + } }