diff options
author | Sandro Santilli <strk@kbt.io> | 2016-11-07 16:30:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-07 16:30:48 +0100 |
commit | ee963f67c1eb023b6ed70a2c0f14c6d3c927b8ac (patch) | |
tree | 3eae6328bce456f64c64c9b1f84edc42263f7de1 /modules/setting/setting.go | |
parent | 9c434ccc5060b1fb1d30e268c9c5a71b00230cd7 (diff) | |
parent | 30be1f48266a0c8bfb080b6df1a4ebee906949b3 (diff) | |
download | gitea-ee963f67c1eb023b6ed70a2c0f14c6d3c927b8ac.tar.gz gitea-ee963f67c1eb023b6ed70a2c0f14c6d3c927b8ac.zip |
Merge pull request #103 from strk/GOGS_drop
Replace GOGS with GITEA in variable names
Diffstat (limited to 'modules/setting/setting.go')
-rw-r--r-- | modules/setting/setting.go | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go index f45a4e090f..9aade4e834 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -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 { |