Show git commit in version (#351)

This commit is contained in:
Uriel authored and GitHub committed 2022-12-16 19:14:33 +03:00
1 parent e7cf1a3008
commit 76de35e28c
11 files changed
+457 -118

No files matched your search

+9 -1
View File
@@ -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 {