Merge pull request #103 from strk/GOGS_drop

Replace GOGS with GITEA in variable names
This commit is contained in:
Sandro Santilli 2016-11-07 16:30:48 +01:00 committed by GitHub
commit ee963f67c1
17 changed files with 142 additions and 126 deletions

View file

@ -297,10 +297,18 @@ func init() {
// WorkDir returns absolute path of work directory.
func WorkDir() (string, error) {
wd := os.Getenv("GOGS_WORK_DIR")
wd := os.Getenv("GITEA_WORK_DIR")
if len(wd) > 0 {
return wd, nil
}
// Use GOGS_WORK_DIR if available, for backward compatibility
// TODO: drop in 1.1.0 ?
wd = os.Getenv("GOGS_WORK_DIR")
if len(wd) > 0 {
log.Warn(`Usage of GOGS_WORK_DIR is deprecated and will be *removed* in a future release,
please consider changing to GITEA_WORK_DIR`)
return wd, nil
}
i := strings.LastIndex(AppPath, "/")
if i == -1 {
@ -341,9 +349,17 @@ func NewContext() {
log.Fatal(4, "Fail to parse 'conf/app.ini': %v", err)
}
CustomPath = os.Getenv("GOGS_CUSTOM")
CustomPath = os.Getenv("GITEA_CUSTOM")
if len(CustomPath) == 0 {
CustomPath = workDir + "/custom"
// For backward compatibility
// TODO: drop in 1.1.0 ?
CustomPath = os.Getenv("GOGS_CUSTOM")
if len(CustomPath) == 0 {
CustomPath = workDir + "/custom"
} else {
log.Warn(`Usage of GOGS_CUSTOM is deprecated and will be *removed* in a future release,
please consider changing to GITEA_CUSTOM`)
}
}
if len(CustomConf) == 0 {