mirror of
https://github.com/zigholding/obsidian-notesync-plugin.git
synced 2026-07-22 05:43:30 +00:00
只选择有plugins目录的配置
This commit is contained in:
parent
73e4e20350
commit
5cfb94be1e
1 changed files with 9 additions and 3 deletions
|
|
@ -3,6 +3,7 @@ import {
|
|||
} from 'obsidian';
|
||||
|
||||
import NoteSyncPlugin from '../main';
|
||||
import { it } from 'node:test';
|
||||
|
||||
const cmd_export_current_note = (plugin:NoteSyncPlugin) => ({
|
||||
id: 'cmd_export_current_note',
|
||||
|
|
@ -54,9 +55,14 @@ const cmd_export_plugin = (plugin:NoteSyncPlugin) => ({
|
|||
if(target){
|
||||
let items = plugin.fsEditor.list_dir(target,false)
|
||||
items = items.filter((x:string)=>x.startsWith('.') && x!='.git').filter(
|
||||
(x:string)=>plugin.fsEditor.isdir(
|
||||
plugin.fsEditor.path.join(target,x)
|
||||
)
|
||||
(x:string)=>{
|
||||
let path = plugin.fsEditor.path.join(target,x)
|
||||
if(!plugin.fsEditor.isdir(path)){
|
||||
return false
|
||||
}
|
||||
let items = plugin.fsEditor.list_dir(path,false)
|
||||
return items.contains('plugins')
|
||||
}
|
||||
)
|
||||
if(items.length==1){
|
||||
target = plugin.fsEditor.path.join(target,items[0],'plugins')
|
||||
|
|
|
|||
Loading…
Reference in a new issue