🎨 搜索资源文件支持跟随 assets 文件夹符号链接 Fix https://github.com/siyuan-note/siyuan/issues/6217

This commit is contained in:
Liang Ding 2022-10-16 14:15:42 +08:00
parent a00e25cd1e
commit 56128b9cb7
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
3 changed files with 22 additions and 28 deletions

View file

@ -534,3 +534,21 @@ func IsValidPandocBin(binPath string) bool {
}
return false
}
func GetDataAssetsAbsPath() (ret string) {
ret = filepath.Join(DataDir, "assets")
var err error
stat, err := os.Lstat(ret)
if nil != err {
logging.LogErrorf("stat assets failed: %s", err)
return
}
if 0 != stat.Mode()&os.ModeSymlink {
// 跟随符号链接 https://github.com/siyuan-note/siyuan/issues/5480
ret, err = os.Readlink(ret)
if nil != err {
logging.LogErrorf("read assets link failed: %s", err)
}
}
return
}