diff options
-rw-r--r-- | cmd/web.go | 2 | ||||
-rw-r--r-- | gogs.go | 2 | ||||
-rw-r--r-- | models/models.go | 6 | ||||
-rw-r--r-- | modules/setting/setting.go | 21 | ||||
-rw-r--r-- | routers/install.go | 3 | ||||
-rw-r--r-- | templates/.VERSION | 2 |
6 files changed, 24 insertions, 12 deletions
@@ -69,7 +69,7 @@ type VerChecker struct { // checkVersion checks if binary matches the version of templates files. func checkVersion() { // Templates. - data, err := ioutil.ReadFile(path.Join(setting.StaticRootPath, "templates/.VERSION")) + data, err := ioutil.ReadFile(setting.StaticRootPath + "/templates/.VERSION") if err != nil { log.Fatal(4, "Fail to read 'templates/.VERSION': %v", err) } @@ -17,7 +17,7 @@ import ( "github.com/gogits/gogs/modules/setting" ) -const APP_VER = "0.6.3.0801 Beta" +const APP_VER = "0.6.3.0802 Beta" func init() { runtime.GOMAXPROCS(runtime.NumCPU()) diff --git a/models/models.go b/models/models.go index 44fd5631..7bed39c4 100644 --- a/models/models.go +++ b/models/models.go @@ -122,7 +122,7 @@ func getEngine() (*xorm.Engine, error) { func NewTestEngine(x *xorm.Engine) (err error) { x, err = getEngine() if err != nil { - return fmt.Errorf("connect to database: %v", err) + return fmt.Errorf("Connect to database: %v", err) } x.SetMapper(core.GonicMapper{}) @@ -132,7 +132,7 @@ func NewTestEngine(x *xorm.Engine) (err error) { func SetEngine() (err error) { x, err = getEngine() if err != nil { - return fmt.Errorf("connect to database: %v", err) + return fmt.Errorf("Connect to database: %v", err) } x.SetMapper(core.GonicMapper{}) @@ -144,7 +144,7 @@ func SetEngine() (err error) { f, err := os.Create(logPath) if err != nil { - return fmt.Errorf("models.init(fail to create xorm.log): %v", err) + return fmt.Errorf("Fail to create xorm.log: %v", err) } x.SetLogger(xorm.NewSimpleLogger(f)) diff --git a/modules/setting/setting.go b/modules/setting/setting.go index f826a3a4..c39fab43 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -168,7 +168,18 @@ func ExecPath() (string, error) { // WorkDir returns absolute path of work directory. func WorkDir() (string, error) { execPath, err := ExecPath() - return path.Dir(strings.Replace(execPath, "\\", "/", -1)), err + if err != nil { + return execPath, err + } + + // Note: we don't use path.Dir here because it does not handle case + // which path starts with two "/" in Windows: "//psf/Home/..." + execPath = strings.Replace(execPath, "\\", "/", -1) + i := strings.LastIndex(execPath, "/") + if i == -1 { + return execPath, nil + } + return execPath[:i], nil } func forcePathSeparator(path string) { @@ -192,11 +203,11 @@ func NewConfigContext() { CustomPath = os.Getenv("GOGS_CUSTOM") if len(CustomPath) == 0 { - CustomPath = path.Join(workDir, "custom") + CustomPath = workDir + "/custom" } if len(CustomConf) == 0 { - CustomConf = path.Join(CustomPath, "conf/app.ini") + CustomConf = CustomPath + "/conf/app.ini" } if com.IsFile(CustomConf) { @@ -449,10 +460,10 @@ func newLogService() { func newCacheService() { CacheAdapter = Cfg.Section("cache").Key("ADAPTER").In("memory", []string{"memory", "redis", "memcache"}) if EnableRedis { - log.Info("Redis Enabled") + log.Info("Redis Supported") } if EnableMemcache { - log.Info("Memcache Enabled") + log.Info("Memcache Supported") } switch CacheAdapter { diff --git a/routers/install.go b/routers/install.go index f9b5aa10..3d3e8997 100644 --- a/routers/install.go +++ b/routers/install.go @@ -72,7 +72,7 @@ func GlobalInit() { log.NewGitLogger(path.Join(setting.LogRootPath, "http.log")) } if models.EnableSQLite3 { - log.Info("SQLite3 Enabled") + log.Info("SQLite3 Supported") } checkRunMode() } @@ -213,6 +213,7 @@ func InstallPost(ctx *middleware.Context, form auth.InstallForm) { // Check admin password. if form.AdminPasswd != form.AdminConfirmPasswd { + ctx.Data["Err_Admin"] = true ctx.Data["Err_AdminPasswd"] = true ctx.RenderWithErr(ctx.Tr("form.password_not_match"), INSTALL, form) return diff --git a/templates/.VERSION b/templates/.VERSION index 2aa534a5..8c77c216 100644 --- a/templates/.VERSION +++ b/templates/.VERSION @@ -1 +1 @@ -0.6.3.0801 Beta
\ No newline at end of file +0.6.3.0802 Beta
\ No newline at end of file |