1
0
forked from xjboss/KCauldronX

Fix updater

This commit is contained in:
Prototik
2015-06-22 02:01:58 +07:00
parent f27a9310b6
commit 997543753e
5 changed files with 71 additions and 28 deletions

View File

@ -32,6 +32,7 @@ public class KCauldron {
sServerLocation = new File(jarFilePath);
sCurrentVersion = version;
sGroup = manifest.getProperty("KCauldron-Group");
sBranch = manifest.getProperty("KCauldron-Branch");
sChannel = manifest.getProperty("KCauldron-Channel");
break;
@ -41,10 +42,6 @@ public class KCauldron {
} catch (Exception e) {
e.printStackTrace();
}
String home = System.getenv("KCAULDRON_HOME");
if (home != null) {
sServerLocation = new File(home);
}
}
private static String sCurrentVersion;
@ -60,6 +57,28 @@ public class KCauldron {
parseManifest();
return sServerLocation;
}
private static File sServerHome;
public static File getServerHome() {
if (sServerHome == null) {
String home = System.getenv("KCAULDRON_HOME");
if (home != null) {
sServerHome = new File(home);
} else {
parseManifest();
sServerHome = sServerLocation.getParentFile();
}
}
return sServerHome;
}
private static String sGroup;
public static String getGroup() {
parseManifest();
return sGroup;
}
private static String sBranch;