mirror of
https://github.com/jxpeng98/obsidian-to-NotionNext
synced 2026-07-29 08:08:34 +08:00
Update use file modify instead of fs write
This commit is contained in:
@@ -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}`)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user