mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-24 02:20:13 +01:00
♻️ Container 常量化
This commit is contained in:
parent
379e27aefe
commit
7f9c598061
7 changed files with 17 additions and 10 deletions
|
|
@ -77,9 +77,9 @@ func Boot() {
|
|||
Resident = *resident
|
||||
ReadOnly = *readOnly
|
||||
AccessAuthCode = *accessAuthCode
|
||||
Container = "std"
|
||||
Container = ContainerStd
|
||||
if isRunningInDockerContainer() {
|
||||
Container = "docker"
|
||||
Container = ContainerDocker
|
||||
}
|
||||
|
||||
UserAgent = UserAgent + " " + Container
|
||||
|
|
@ -177,7 +177,7 @@ func initWorkspaceDir(workspaceArg string) {
|
|||
userHomeConfDir := filepath.Join(HomeDir, ".config", "siyuan")
|
||||
workspaceConf := filepath.Join(userHomeConfDir, "workspace.json")
|
||||
if !gulu.File.IsExist(workspaceConf) {
|
||||
IsNewbie = "std" == Container // 只有桌面端需要设置新手标识,前端自动挂载帮助文档
|
||||
IsNewbie = ContainerStd == Container // 只有桌面端需要设置新手标识,前端自动挂载帮助文档
|
||||
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)
|
||||
|
|
@ -276,6 +276,13 @@ var (
|
|||
Container string // docker, android, ios, std
|
||||
)
|
||||
|
||||
const (
|
||||
ContainerStd = "std" // 桌面端
|
||||
ContainerDocker = "docker" // Docker 容器端
|
||||
ContainerAndroid = "android" // Android 端
|
||||
ContainerIOS = "ios" // iOS 端
|
||||
)
|
||||
|
||||
func initPathDir() {
|
||||
if err := os.MkdirAll(ConfDir, 0755); nil != err && !os.IsExist(err) {
|
||||
log.Fatalf("create conf folder [%s] failed: %s", ConfDir, err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue