diff options
author | Pacien TRAN-GIRARD | 2012-09-22 23:40:07 +0200 |
---|---|---|
committer | Pacien | 2015-12-07 22:48:26 +0100 |
commit | 68c6f64333bf8756db31c5ceae0f040162703c0f (patch) | |
tree | 52e7ee5e200501b4b9dd3b38a43e954e17718b81 | |
parent | e1cb51c756aaabb4cd3747934b9185c3bc834de6 (diff) | |
download | ninja-go-local-cloud-68c6f64333bf8756db31c5ceae0f040162703c0f.tar.gz |
Fix path separator in URI on Windows (\ to /).
-rw-r--r-- | src/ninjacloud.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/ninjacloud.go b/src/ninjacloud.go index f15d7f1..5632709 100644 --- a/src/ninjacloud.go +++ b/src/ninjacloud.go | |||
@@ -234,10 +234,12 @@ func listDir(path string, recursive bool, filter []string, returnType string) (l | |||
234 | var e element | 234 | var e element |
235 | modTime := strconv.FormatInt(d.ModTime().UnixNano(), 10) | 235 | modTime := strconv.FormatInt(d.ModTime().UnixNano(), 10) |
236 | modTime = modTime[:len(modTime)-6] | 236 | modTime = modTime[:len(modTime)-6] |
237 | uri := filepath.Clean(path + "/" + d.Name()) | 237 | uri := path + "/" + d.Name() |
238 | uri = filepath.Clean(drivePrefix + projectsDir + "/" + uri) | ||
239 | uri = filepath.ToSlash(uri) | ||
238 | e.Type = "directory" | 240 | e.Type = "directory" |
239 | e.Name = d.Name() | 241 | e.Name = d.Name() |
240 | e.Uri = filepath.Clean(drivePrefix + projectsDir + "/" + uri) | 242 | e.Uri = uri |
241 | e.CreationDate = modTime // TODO | 243 | e.CreationDate = modTime // TODO |
242 | e.ModifiedDate = modTime | 244 | e.ModifiedDate = modTime |
243 | e.Size = strconv.FormatInt(d.Size(), 10) | 245 | e.Size = strconv.FormatInt(d.Size(), 10) |
@@ -260,9 +262,11 @@ func listDir(path string, recursive bool, filter []string, returnType string) (l | |||
260 | var e element | 262 | var e element |
261 | modTime := strconv.FormatInt(d.ModTime().UnixNano(), 10) | 263 | modTime := strconv.FormatInt(d.ModTime().UnixNano(), 10) |
262 | modTime = modTime[:len(modTime)-6] | 264 | modTime = modTime[:len(modTime)-6] |
265 | uri := filepath.Clean(drivePrefix + projectsDir + "/" + path + "/" + d.Name()) | ||
266 | uri = filepath.ToSlash(uri) | ||
263 | e.Type = "file" | 267 | e.Type = "file" |
264 | e.Name = d.Name() | 268 | e.Name = d.Name() |
265 | e.Uri = filepath.Clean(drivePrefix + projectsDir + "/" + path + "/" + d.Name()) | 269 | e.Uri = uri |
266 | e.CreationDate = modTime // TODO | 270 | e.CreationDate = modTime // TODO |
267 | e.ModifiedDate = modTime | 271 | e.ModifiedDate = modTime |
268 | e.Size = strconv.FormatInt(d.Size(), 10) | 272 | e.Size = strconv.FormatInt(d.Size(), 10) |