summaryrefslogtreecommitdiffstats
path: root/modules/setting
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-03-18 06:37:44 -0400
committerUnknwon <u@gogs.io>2015-03-18 06:37:44 -0400
commite6cf83b8c0202ca256ce1b5aaa26459aaaa6532a (patch)
treea64d8d45372a266650b4b3540d4d04c3418b0227 /modules/setting
parentdeee2d5fa848106db3f00dcb33490dc9b5b61e29 (diff)
downloadgitea-e6cf83b8c0202ca256ce1b5aaa26459aaaa6532a.tar.gz
gitea-e6cf83b8c0202ca256ce1b5aaa26459aaaa6532a.zip
Put default config into binary
Diffstat (limited to 'modules/setting')
-rw-r--r--modules/setting/setting.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go
index 0bc8c99bdc..790014071b 100644
--- a/modules/setting/setting.go
+++ b/modules/setting/setting.go
@@ -20,6 +20,7 @@ import (
"github.com/macaron-contrib/session"
"gopkg.in/ini.v1"
+ "github.com/gogits/gogs/modules/bindata"
"github.com/gogits/gogs/modules/log"
// "github.com/gogits/gogs/modules/ssh"
)
@@ -131,7 +132,6 @@ var (
// Global setting objects.
Cfg *ini.File
- ConfRootPath string
CustomPath string // Custom directory path.
CustomConf string
ProdMode bool
@@ -165,8 +165,7 @@ func WorkDir() (string, error) {
func forcePathSeparator(path string) {
if strings.Contains(path, "\\") {
- fmt.Println("Do not use '\\' or '\\\\' in paths, instead, please use '/' in all places")
- os.Exit(1)
+ log.Fatal(4, "Do not use '\\' or '\\\\' in paths, instead, please use '/' in all places")
}
}
@@ -177,9 +176,8 @@ func NewConfigContext() {
if err != nil {
log.Fatal(4, "Fail to get work directory: %v", err)
}
- ConfRootPath = path.Join(workDir, "conf")
- Cfg, err = ini.Load(path.Join(workDir, "conf/app.ini"))
+ Cfg, err = ini.Load(bindata.MustAsset("conf/app.ini"))
if err != nil {
log.Fatal(4, "Fail to parse 'conf/app.ini': %v", err)
}