mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
:octocat: 补充 PR 模板 https://github.com/siyuan-note/siyuan/pull/6471
This commit is contained in:
parent
89166ca0d5
commit
75925c9e4f
2 changed files with 25 additions and 10 deletions
|
|
@ -178,11 +178,12 @@ func NormalizeEndpoint(endpoint string) string {
|
|||
func FilterMoveDocFromPaths(fromPaths []string, toPath string) (retFromPaths []string) {
|
||||
fromPaths = append(fromPaths, toPath)
|
||||
retFromPaths = FilterSelfChildDocs(fromPaths)
|
||||
retFromPaths = gulu.Str.ExcludeElem(retFromPaths, []string{toPath})
|
||||
return
|
||||
}
|
||||
|
||||
func FilterSelfChildDocs(paths []string) (ret []string) {
|
||||
sort.Slice(paths, func(i, j int) bool { return len(paths[i]) < len(paths[j]) })
|
||||
sort.Slice(paths, func(i, j int) bool { return strings.Count(paths[i], "/") < strings.Count(paths[j], "/") })
|
||||
|
||||
dirs := map[string]string{}
|
||||
for _, fromPath := range paths {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue