mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 All plain text formats are supported when comparing data snapshots https://github.com/siyuan-note/siyuan/issues/12975
This commit is contained in:
parent
641550e1ed
commit
6db7b847e9
5 changed files with 19 additions and 37 deletions
|
|
@ -20,7 +20,6 @@ import (
|
|||
"bytes"
|
||||
"io"
|
||||
"io/fs"
|
||||
"mime"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
|
|
@ -30,7 +29,6 @@ import (
|
|||
|
||||
"github.com/88250/gulu"
|
||||
"github.com/88250/lute/ast"
|
||||
"github.com/gabriel-vasile/mimetype"
|
||||
"github.com/siyuan-note/filelock"
|
||||
"github.com/siyuan-note/logging"
|
||||
)
|
||||
|
|
@ -75,21 +73,6 @@ func GetUniqueFilename(filePath string) string {
|
|||
}
|
||||
}
|
||||
|
||||
func GetMimeTypeByExt(filePath string) (ret string) {
|
||||
ret = mime.TypeByExtension(filepath.Ext(filePath))
|
||||
if "" == ret {
|
||||
m, err := mimetype.DetectFile(filePath)
|
||||
if err != nil {
|
||||
logging.LogErrorf("detect mime type of [%s] failed: %s", filePath, err)
|
||||
return
|
||||
}
|
||||
if nil != m {
|
||||
ret = m.String()
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func IsSymlinkPath(absPath string) bool {
|
||||
fi, err := os.Lstat(absPath)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue