🔧 简化配置
This commit is contained in:
parent
5989d0fb7b
commit
be63fc0d16
18
conf/wide.go
18
conf/wide.go
|
@ -214,6 +214,14 @@ func initWide(confPath, confUsers, confServer, confLogLevel, confPlayground stri
|
||||||
if "" != confPlayground {
|
if "" != confPlayground {
|
||||||
Wide.Playground = confPlayground
|
Wide.Playground = confPlayground
|
||||||
}
|
}
|
||||||
|
Wide.Playground = filepath.FromSlash(Wide.Playground)
|
||||||
|
if !util.File.IsExist(Wide.Playground) {
|
||||||
|
if err := os.MkdirAll(Wide.Playground, 0775); nil != err {
|
||||||
|
logger.Errorf("Create Playground [%s] error", err)
|
||||||
|
|
||||||
|
os.Exit(-1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Users' workspaces directory
|
// Users' workspaces directory
|
||||||
Wide.UsersWorkspaces = strings.Replace(Wide.UsersWorkspaces, "${WD}", Wide.WD, 1)
|
Wide.UsersWorkspaces = strings.Replace(Wide.UsersWorkspaces, "${WD}", Wide.WD, 1)
|
||||||
|
@ -221,16 +229,16 @@ func initWide(confPath, confUsers, confServer, confLogLevel, confPlayground stri
|
||||||
if "" != confUsersWorkspaces {
|
if "" != confUsersWorkspaces {
|
||||||
Wide.UsersWorkspaces = confUsersWorkspaces
|
Wide.UsersWorkspaces = confUsersWorkspaces
|
||||||
}
|
}
|
||||||
Wide.UsersWorkspaces = filepath.Clean(Wide.UsersWorkspaces)
|
Wide.UsersWorkspaces = filepath.FromSlash(Wide.UsersWorkspaces)
|
||||||
|
if !util.File.IsExist(Wide.UsersWorkspaces) {
|
||||||
if !util.File.IsExist(Wide.Playground) {
|
if err := os.MkdirAll(Wide.UsersWorkspaces, 0775); nil != err {
|
||||||
if err := os.Mkdir(Wide.Playground, 0775); nil != err {
|
logger.Errorf("Create Workspaces [%s] error", err)
|
||||||
logger.Errorf("Create Playground [%s] error", err)
|
|
||||||
|
|
||||||
os.Exit(-1)
|
os.Exit(-1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Server
|
// Server
|
||||||
if "" != confServer {
|
if "" != confServer {
|
||||||
Wide.Server = confServer
|
Wide.Server = confServer
|
||||||
|
|
|
@ -5,11 +5,10 @@
|
||||||
"StaticResourceVersion": "${time}",
|
"StaticResourceVersion": "${time}",
|
||||||
"MaxProcs": 4,
|
"MaxProcs": 4,
|
||||||
"RuntimeMode": "dev",
|
"RuntimeMode": "dev",
|
||||||
"WD": "${pwd}",
|
|
||||||
"Locale": "en_US",
|
"Locale": "en_US",
|
||||||
"Playground": "${home}/playground",
|
"Playground": "${home}/wide/playground",
|
||||||
"Users": "conf/users",
|
"Users": "conf/users",
|
||||||
"UsersWorkspaces": "${WD}/workspaces",
|
"UsersWorkspaces": "${home}/wide/workspaces",
|
||||||
"AllowRegister": true,
|
"AllowRegister": true,
|
||||||
"Autocomplete": true
|
"Autocomplete": true
|
||||||
}
|
}
|
Loading…
Reference in New Issue