mirror of
https://github.com/zigholding/obsidian-notesync-plugin.git
synced 2026-07-22 05:43:30 +00:00
fix \g to /
This commit is contained in:
parent
5cab93b3c2
commit
132e849e33
3 changed files with 11 additions and 7 deletions
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"pluginDirExporter": "D:\\iLanix\\isync\\Obsidian\\.obsidian\\plugins",
|
||||
"vaultDir": "D:\\iLanix\\isync\\Obsidian"
|
||||
"pluginDirExporter": "D:\\iLanix\\Obsidian\\.obsidian\\plugins\nD:\\iLanix\\Obsidian\\.mobile\\plugins\nD:\\DataSync\\BaiduSyncdisk\\ZigHoldingShare\\ObsidianBaiduDisk\\.obsidian\\plugins\nD:\\github\\ObsidianZ-final\\.obsidian\\plugins",
|
||||
"vaultDir": "D:\\iLanix\\isync\\Obsidian\nD:\\github\\ObsidianZ-final\nD:\\iLanix\\Obsidian"
|
||||
}
|
||||
8
main.js
8
main.js
File diff suppressed because one or more lines are too long
|
|
@ -114,16 +114,18 @@ export class FsEditor{
|
|||
mirror_tfile(tfile:TFile,vault_root:string,mode='mtime',attachment=true,outlink=false){
|
||||
// 将笔记镜像移动到别的库中,文件结构与当前库相同
|
||||
if(tfile){
|
||||
vault_root = vault_root.replace(/\\g/,'/');
|
||||
vault_root = vault_root.replace(/\\/g,'/');
|
||||
let src = this.root + '/' + tfile.path;
|
||||
let dst = vault_root+'/'+tfile.path;
|
||||
this.mkdir_recursive(this.path.dirname(dst));
|
||||
this.copy_file(src,dst,mode);
|
||||
if(attachment){
|
||||
console.log('attachment')
|
||||
let nc = (this.plugin.app as any).plugins.getPlugin('note-chain');
|
||||
if(!nc){return;}
|
||||
let tfiles = nc.chain.get_outlinks(tfile);
|
||||
let tfiles = nc.chain.get_outlinks(tfile,false);
|
||||
for(let t of tfiles){
|
||||
console.log(t.name)
|
||||
if(!(t.extension==='md')){
|
||||
this.mirror_tfile(t,vault_root,mode,false);
|
||||
}else if(outlink){
|
||||
|
|
|
|||
Loading…
Reference in a new issue