From be63fc0d16ca88c3d2fa968c9532190e79f11334 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Fri, 17 May 2019 00:49:13 +0800 Subject: [PATCH] =?UTF-8?q?:wrench:=20=E7=AE=80=E5=8C=96=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- conf/wide.go | 18 +++++++++++++----- conf/wide.json | 5 ++--- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/conf/wide.go b/conf/wide.go index 15a7a45..1c1adec 100644 --- a/conf/wide.go +++ b/conf/wide.go @@ -214,6 +214,14 @@ func initWide(confPath, confUsers, confServer, confLogLevel, confPlayground stri if "" != 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 Wide.UsersWorkspaces = strings.Replace(Wide.UsersWorkspaces, "${WD}", Wide.WD, 1) @@ -221,16 +229,16 @@ func initWide(confPath, confUsers, confServer, confLogLevel, confPlayground stri if "" != confUsersWorkspaces { Wide.UsersWorkspaces = confUsersWorkspaces } - Wide.UsersWorkspaces = filepath.Clean(Wide.UsersWorkspaces) - - if !util.File.IsExist(Wide.Playground) { - if err := os.Mkdir(Wide.Playground, 0775); nil != err { - logger.Errorf("Create Playground [%s] error", err) + Wide.UsersWorkspaces = filepath.FromSlash(Wide.UsersWorkspaces) + if !util.File.IsExist(Wide.UsersWorkspaces) { + if err := os.MkdirAll(Wide.UsersWorkspaces, 0775); nil != err { + logger.Errorf("Create Workspaces [%s] error", err) os.Exit(-1) } } + // Server if "" != confServer { Wide.Server = confServer diff --git a/conf/wide.json b/conf/wide.json index 1bd6144..fc2a165 100644 --- a/conf/wide.json +++ b/conf/wide.json @@ -5,11 +5,10 @@ "StaticResourceVersion": "${time}", "MaxProcs": 4, "RuntimeMode": "dev", - "WD": "${pwd}", "Locale": "en_US", - "Playground": "${home}/playground", + "Playground": "${home}/wide/playground", "Users": "conf/users", - "UsersWorkspaces": "${WD}/workspaces", + "UsersWorkspaces": "${home}/wide/workspaces", "AllowRegister": true, "Autocomplete": true } \ No newline at end of file