mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 移动端导入大于 32M 的 Data 包失败 https://github.com/siyuan-note/siyuan/issues/5067
This commit is contained in:
parent
53e90d4e29
commit
6e24e483d6
2 changed files with 13 additions and 0 deletions
|
|
@ -250,6 +250,14 @@ func initWorkspaceDir(workspaceArg string) {
|
||||||
ConfDir = filepath.Join(WorkspaceDir, "conf")
|
ConfDir = filepath.Join(WorkspaceDir, "conf")
|
||||||
DataDir = filepath.Join(WorkspaceDir, "data")
|
DataDir = filepath.Join(WorkspaceDir, "data")
|
||||||
TempDir = filepath.Join(WorkspaceDir, "temp")
|
TempDir = filepath.Join(WorkspaceDir, "temp")
|
||||||
|
osTmpDir := filepath.Join(TempDir, "os")
|
||||||
|
os.RemoveAll(osTmpDir)
|
||||||
|
if err := os.MkdirAll(osTmpDir, 0755); nil != err {
|
||||||
|
log.Fatalf("create os tmp dir [%s] failed: %s", osTmpDir, err)
|
||||||
|
}
|
||||||
|
os.Setenv("TMPDIR", osTmpDir)
|
||||||
|
os.Setenv("TEMP", osTmpDir)
|
||||||
|
os.Setenv("TMP", osTmpDir)
|
||||||
DBPath = filepath.Join(TempDir, DBName)
|
DBPath = filepath.Join(TempDir, DBName)
|
||||||
BlockTreePath = filepath.Join(TempDir, "blocktree.msgpack")
|
BlockTreePath = filepath.Join(TempDir, "blocktree.msgpack")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ package util
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"math/rand"
|
"math/rand"
|
||||||
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
|
@ -35,6 +36,10 @@ func BootMobile(container, appDir, workspaceDir, nativeLibDir, privateDataDir, l
|
||||||
ConfDir = filepath.Join(workspaceDir, "conf")
|
ConfDir = filepath.Join(workspaceDir, "conf")
|
||||||
DataDir = filepath.Join(workspaceDir, "data")
|
DataDir = filepath.Join(workspaceDir, "data")
|
||||||
TempDir = filepath.Join(workspaceDir, "temp")
|
TempDir = filepath.Join(workspaceDir, "temp")
|
||||||
|
osTmpDir := filepath.Join(TempDir, "os")
|
||||||
|
os.RemoveAll(osTmpDir)
|
||||||
|
os.MkdirAll(osTmpDir, 0755)
|
||||||
|
os.Setenv("TMPDIR", osTmpDir)
|
||||||
DBPath = filepath.Join(TempDir, DBName)
|
DBPath = filepath.Join(TempDir, DBName)
|
||||||
BlockTreePath = filepath.Join(TempDir, "blocktree.msgpack")
|
BlockTreePath = filepath.Join(TempDir, "blocktree.msgpack")
|
||||||
AndroidNativeLibDir = nativeLibDir
|
AndroidNativeLibDir = nativeLibDir
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue