mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-11-26 20:06:28 -08:00
Show git commit in version (#351)
This commit is contained in:
1 parent
e7cf1a3008
commit
76de35e28c
11 files changed
+457
-118
No files matched your search
@@ -13,7 +13,9 @@ import java.net.ServerSocket;
|
||||
|
||||
public class Main {
|
||||
|
||||
public static String VERSION = "0.5.1";
|
||||
public static final String VERSION = (BuildConfig.GIT_VERSION_TAG.isEmpty()
|
||||
? BuildConfig.GIT_COMMIT_HASH
|
||||
: BuildConfig.GIT_VERSION_TAG) + (BuildConfig.GIT_CLEAN ? "" : "-dirty");
|
||||
|
||||
public static VRServer vrServer;
|
||||
|
||||
@@ -28,8 +30,10 @@ public class Main {
|
||||
Options options = new Options();
|
||||
|
||||
Option help = new Option("h", "help", false, "Show help");
|
||||
Option version = new Option("V", "version", false, "Show version");
|
||||
|
||||
options.addOption(help);
|
||||
options.addOption(version);
|
||||
try {
|
||||
cmd = parser.parse(options, args, true);
|
||||
} catch (ParseException e) {
|
||||
@@ -42,6 +46,10 @@ public class Main {
|
||||
formatter.printHelp("slimevr.jar", options);
|
||||
System.exit(0);
|
||||
}
|
||||
if (cmd.hasOption("version")) {
|
||||
System.out.println("SlimeVR Server " + VERSION);
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
File dir = new File("").getAbsoluteFile();
|
||||
try {
|
||||
|
||||
Reference in new issue
Block a user