]> source.dussan.org Git - gitea.git/commitdiff
Absolute path for setting.CustomConf 1923/head
authorEthan Koenig <ethantkoenig@gmail.com>
Sat, 10 Jun 2017 02:27:13 +0000 (22:27 -0400)
committerEthan Koenig <ethantkoenig@gmail.com>
Sat, 10 Jun 2017 02:27:13 +0000 (22:27 -0400)
integrations/integration_test.go

index a0271ce6bf6fa59f8cd006c9f5136b49b9d453f2..77a5a2b727b01ae76781163def0cacca5fa0d746 100644 (file)
@@ -60,15 +60,21 @@ func TestMain(m *testing.M) {
 }
 
 func initIntegrationTest() {
-       if setting.CustomConf = os.Getenv("GITEA_CONF"); setting.CustomConf == "" {
-               fmt.Println("Environment variable $GITEA_CONF not set")
+       giteaRoot := os.Getenv("GITEA_ROOT")
+       if giteaRoot == "" {
+               fmt.Println("Environment variable $GITEA_ROOT not set")
                os.Exit(1)
        }
-       if giteaRoot := os.Getenv("GITEA_ROOT"); giteaRoot == "" {
-               fmt.Println("Environment variable $GITEA_ROOT not set")
+       setting.AppPath = path.Join(giteaRoot, "gitea")
+
+       giteaConf := os.Getenv("GITEA_CONF")
+       if giteaConf == "" {
+               fmt.Println("Environment variable $GITEA_CONF not set")
                os.Exit(1)
+       } else if !path.IsAbs(giteaConf) {
+               setting.CustomConf = path.Join(giteaRoot, giteaConf)
        } else {
-               setting.AppPath = path.Join(giteaRoot, "gitea")
+               setting.CustomConf = giteaConf
        }
 
        setting.NewContext()