mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
♻️ 将退出码移到 logging 项目中
This commit is contained in:
parent
e99b7fd588
commit
2601605953
13 changed files with 29 additions and 39 deletions
|
|
@ -190,7 +190,7 @@ func initWorkspaceDir(workspaceArg string) {
|
|||
if !gulu.File.IsExist(workspaceConf) {
|
||||
if err := os.MkdirAll(userHomeConfDir, 0755); nil != err && !os.IsExist(err) {
|
||||
log.Printf("create user home conf folder [%s] failed: %s", userHomeConfDir, err)
|
||||
os.Exit(ExitCodeCreateConfDirErr)
|
||||
os.Exit(logging.ExitCodeCreateConfDirErr)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -203,7 +203,7 @@ func initWorkspaceDir(workspaceArg string) {
|
|||
}
|
||||
if err := os.MkdirAll(defaultWorkspaceDir, 0755); nil != err && !os.IsExist(err) {
|
||||
log.Printf("create default workspace folder [%s] failed: %s", defaultWorkspaceDir, err)
|
||||
os.Exit(ExitCodeCreateWorkspaceDirErr)
|
||||
os.Exit(logging.ExitCodeCreateWorkspaceDirErr)
|
||||
}
|
||||
|
||||
var workspacePaths []string
|
||||
|
|
@ -481,7 +481,7 @@ func tryLockWorkspace() {
|
|||
} else {
|
||||
logging.LogErrorf("lock workspace [%s] failed", WorkspaceDir)
|
||||
}
|
||||
os.Exit(ExitCodeWorkspaceLocked)
|
||||
os.Exit(logging.ExitCodeWorkspaceLocked)
|
||||
}
|
||||
|
||||
func IsWorkspaceLocked(workspacePath string) bool {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue