🎨 macOS 端对工作空间放置在 iCloud 路径下做检查 https://github.com/siyuan-note/siyuan/issues/7747
This commit is contained in:
parent
dae90dd912
commit
932ebc1ad9
1 changed files with 20 additions and 0 deletions
|
@ -267,6 +267,26 @@ func isICloudPath(absPath string) bool {
|
|||
return err
|
||||
}
|
||||
|
||||
if 0 != info.Mode()&os.ModeSymlink && 0 != info.Mode()&os.ModeDir {
|
||||
resolved, symErr := filepath.EvalSymlinks(path)
|
||||
if nil != symErr {
|
||||
logging.LogErrorf("resolve symlink [%s] failed: %s", path, symErr)
|
||||
return nil
|
||||
}
|
||||
filepath.Walk(resolved, func(path string, info os.FileInfo, err error) error {
|
||||
if nil != err {
|
||||
return err
|
||||
}
|
||||
|
||||
if absPath == strings.ToLower(path) {
|
||||
logging.LogInfof("under symlink path: %s", path)
|
||||
return fmt.Errorf("found")
|
||||
}
|
||||
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
logging.LogInfof("path: %s", path)
|
||||
return nil
|
||||
})
|
||||
|
|
Loading…
Add table
Reference in a new issue