mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +01:00
🎨 Improve boot
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
a110f902d5
commit
e256101bd9
1 changed files with 8 additions and 0 deletions
|
|
@ -21,6 +21,7 @@ import (
|
|||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/88250/gulu"
|
||||
|
|
@ -117,6 +118,7 @@ func initWorkspaceDirMobile(workspaceBaseDir string) {
|
|||
|
||||
var workspacePaths []string
|
||||
if !gulu.File.IsExist(workspaceConf) {
|
||||
logging.LogInfof("workspace conf [%s] not exist, use the default workspace [%s]", workspaceConf, defaultWorkspaceDir)
|
||||
WorkspaceDir = defaultWorkspaceDir
|
||||
if !gulu.File.IsDir(WorkspaceDir) {
|
||||
logging.LogWarnf("use the default workspace [%s] since the specified workspace [%s] is not a dir", WorkspaceDir, defaultWorkspaceDir)
|
||||
|
|
@ -125,6 +127,8 @@ func initWorkspaceDirMobile(workspaceBaseDir string) {
|
|||
workspacePaths = append(workspacePaths, WorkspaceDir)
|
||||
} else {
|
||||
workspacePaths, _ = ReadWorkspacePaths()
|
||||
logging.LogInfof("1 read workspace paths [%s]", strings.Join(workspacePaths, ","))
|
||||
|
||||
if 0 < len(workspacePaths) {
|
||||
WorkspaceDir = workspacePaths[len(workspacePaths)-1]
|
||||
if !gulu.File.IsDir(WorkspaceDir) {
|
||||
|
|
@ -136,8 +140,12 @@ func initWorkspaceDirMobile(workspaceBaseDir string) {
|
|||
WorkspaceDir = defaultWorkspaceDir
|
||||
workspacePaths = append(workspacePaths, WorkspaceDir)
|
||||
}
|
||||
|
||||
logging.LogInfof("2 read workspace paths [%s]", strings.Join(workspacePaths, ","))
|
||||
}
|
||||
|
||||
logging.LogInfof("3 read workspace paths [%s]", strings.Join(workspacePaths, ","))
|
||||
|
||||
if err := WriteWorkspacePaths(workspacePaths); err != nil {
|
||||
logging.LogErrorf("write workspace conf [%s] failed: %s", workspaceConf, err)
|
||||
os.Exit(logging.ExitCodeInitWorkspaceErr)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue