🎨 资源文件夹不存在时自动创建
This commit is contained in:
parent
f3413cb583
commit
7959a6a994
1 changed files with 6 additions and 0 deletions
|
@ -19,9 +19,11 @@
|
|||
package model
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
"github.com/88250/gulu"
|
||||
"github.com/fsnotify/fsnotify"
|
||||
"github.com/siyuan-note/logging"
|
||||
"github.com/siyuan-note/siyuan/kernel/cache"
|
||||
|
@ -89,6 +91,10 @@ func watchAssets() {
|
|||
}
|
||||
}()
|
||||
|
||||
if !gulu.File.IsDir(assetsDir) {
|
||||
os.MkdirAll(assetsDir, 0755)
|
||||
}
|
||||
|
||||
if err = assetsWatcher.Add(assetsDir); err != nil {
|
||||
logging.LogErrorf("add assets watcher for folder [%s] failed: %s", assetsDir, err)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue