mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 搜索资源文件支持跟随 assets 文件夹符号链接 Fix https://github.com/siyuan-note/siyuan/issues/6217
This commit is contained in:
parent
a00e25cd1e
commit
56128b9cb7
3 changed files with 22 additions and 28 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue