mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-02 03:26:06 +01:00
use switch
This commit is contained in:
@@ -19,19 +19,25 @@ public class JettyLauncher {
|
|||||||
if(arg.startsWith("--") && arg.contains("=")) {
|
if(arg.startsWith("--") && arg.contains("=")) {
|
||||||
String[] dim = arg.split("=");
|
String[] dim = arg.split("=");
|
||||||
if(dim.length >= 2) {
|
if(dim.length >= 2) {
|
||||||
if(dim[0].equals("--host")) {
|
switch (dim[0]) {
|
||||||
host = dim[1];
|
case "--host":
|
||||||
} else if(dim[0].equals("--port")) {
|
host = dim[1];
|
||||||
port = Integer.parseInt(dim[1]);
|
break;
|
||||||
} else if(dim[0].equals("--prefix")) {
|
case "--port":
|
||||||
contextPath = dim[1];
|
port = Integer.parseInt(dim[1]);
|
||||||
if(!contextPath.startsWith("/")){
|
break;
|
||||||
contextPath = "/" + contextPath;
|
case "--prefix":
|
||||||
}
|
contextPath = dim[1];
|
||||||
} else if(dim[0].equals("--gitbucket.home")){
|
if (!contextPath.startsWith("/")) {
|
||||||
System.setProperty("gitbucket.home", dim[1]);
|
contextPath = "/" + contextPath;
|
||||||
} else if(dim[0].equals("--temp_dir")){
|
}
|
||||||
tmpDirPath = dim[1];
|
break;
|
||||||
|
case "--gitbucket.home":
|
||||||
|
System.setProperty("gitbucket.home", dim[1]);
|
||||||
|
break;
|
||||||
|
case "--temp_dir":
|
||||||
|
tmpDirPath = dim[1];
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user