system property should take a higher priority than environment variable, as environment variables inherit from processes to processes, system properties don't.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@6904 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2008-01-29 16:35:56 +00:00
1 parent 37390621c2
commit 49a3763b9e
1 file changed
+5 -5
+5 -5
View File
@@ -208,15 +208,15 @@ public class WebAppMain implements ServletContextListener {
// ignore
}
// look at the env var next
String env = EnvVars.masterEnvVars.get("HUDSON_HOME");
if(env!=null)
return new File(env.trim()).getAbsoluteFile();
// finally check the system property
String sysProp = System.getProperty("HUDSON_HOME");
if(sysProp!=null)
return new File(sysProp.trim());
// look at the env var next
String env = EnvVars.masterEnvVars.get("HUDSON_HOME");
if(env!=null)
return new File(env.trim()).getAbsoluteFile();
// otherwise pick a place by ourselves