From b926c497c832f481d3e1085e69f4283e4e92415e Mon Sep 17 00:00:00 2001 From: Pacien TRAN-GIRARD Date: Sat, 22 Sep 2012 18:24:51 +0200 Subject: Use a default subdir for projects. --- src/ninjacloud.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/ninjacloud.go b/src/ninjacloud.go index 58146f7..235a9be 100644 --- a/src/ninjacloud.go +++ b/src/ninjacloud.go @@ -43,6 +43,8 @@ var rootFlag string const driveName = "Z" const drivePrefix = driveName + ":/" +const projectsDir = "Ninja" + const filePath = "/file/" const dirPath = "/directory/" const webPath = "/web?url=" @@ -629,7 +631,7 @@ func getStatusHandler(w http.ResponseWriter, r *http.Request) { cloudStatus := map[string]string{ "name": APP_NAME, "version": APP_VERSION, - "server-root": drivePrefix, + "server-root": drivePrefix + projectsDir, "status": "running", } j, err := json.MarshalIndent(cloudStatus, "", " ") @@ -662,6 +664,12 @@ func main() { log.Println(err) return } + + err = createDir(projectsDir) + if err != nil { + log.Println(err) + return + } log.Println("Starting " + APP_NAME + " " + APP_VERSION + " on " + interfaceFlag + ":" + portFlag + " in " + currentDir) log.Println("pacien.net/projects/ninja-go-local-cloud") -- cgit v1.2.3