From 0f907301b7fbd05faf07bc22b3316ae1093c6724 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 12 Jul 2014 00:55:19 -0400 Subject: Fix #285 --- cmd/fix.go | 12 ++++++++++-- cmd/web.go | 7 ++++++- 2 files changed, 16 insertions(+), 3 deletions(-) (limited to 'cmd') diff --git a/cmd/fix.go b/cmd/fix.go index 95ab3ae66f..dfcd04aa89 100644 --- a/cmd/fix.go +++ b/cmd/fix.go @@ -11,6 +11,7 @@ import ( "io/ioutil" "os" "path" + "runtime" "strings" "github.com/codegangsta/cli" @@ -93,9 +94,16 @@ func rewriteAuthorizedKeys(sshPath, oldPath, newPath string) error { } func rewriteUpdateHook(path, appPath string) error { - rp := strings.NewReplacer("\\", "/", " ", "\\ ") + if runtime.GOOS == "windows" { + rp := strings.NewReplacer("\\", "/") + appPath = "\"" + rp.Replace(appPath) + "\"" + } else { + rp := strings.NewReplacer("\\", "/", " ", "\\ ") + appPath = rp.Replace(appPath) + } + if err := ioutil.WriteFile(path, []byte(fmt.Sprintf(models.TPL_UPDATE_HOOK, - setting.ScriptType, rp.Replace(appPath))), os.ModePerm); err != nil { + setting.ScriptType, appPath)), os.ModePerm); err != nil { return err } return nil diff --git a/cmd/web.go b/cmd/web.go index 5f9c168d88..bb46536542 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -103,7 +103,10 @@ func runWeb(*cli.Context) { r.Post("/markdown/raw", v1.MarkdownRaw) // Users. - r.Get("/users/search", v1.SearchUser) + r.Get("/users/search", v1.SearchUsers) + + // Repositories. + r.Get("/orgs/:org/repos/search", v1.SearchOrgRepositoreis) r.Any("**", func(ctx *middleware.Context) { ctx.JSON(404, &base.ApiJsonErr{"Not Found", v1.DOC_URL}) @@ -182,6 +185,8 @@ func runWeb(*cli.Context) { r.Get("/:authid/delete", admin.DeleteAuthSource) }, adminReq) + m.Get("/:username", ignSignIn, user.Profile) + if martini.Env == martini.Dev { m.Get("/template/**", dev.TemplatePreview) dev.RegisterDebugRoutes(m) -- cgit v1.2.3