mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
🎨 资源文件夹不存在时自动创建
This commit is contained in:
parent
f3413cb583
commit
7959a6a994
1 changed files with 6 additions and 0 deletions
|
|
@ -19,9 +19,11 @@
|
||||||
package model
|
package model
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/88250/gulu"
|
||||||
"github.com/fsnotify/fsnotify"
|
"github.com/fsnotify/fsnotify"
|
||||||
"github.com/siyuan-note/logging"
|
"github.com/siyuan-note/logging"
|
||||||
"github.com/siyuan-note/siyuan/kernel/cache"
|
"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 {
|
if err = assetsWatcher.Add(assetsDir); err != nil {
|
||||||
logging.LogErrorf("add assets watcher for folder [%s] failed: %s", assetsDir, err)
|
logging.LogErrorf("add assets watcher for folder [%s] failed: %s", assetsDir, err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue