leave non-numeric qualifiers in place for version (#439)

Signed-off-by: Kai Kreuzer <kai@openhab.org>
This commit is contained in:
Kai Kreuzer 2018-11-28 10:51:24 +01:00 committed by Wouter Born
parent d7b8f1eaa9
commit b51bf275b9

View File

@ -38,9 +38,12 @@ public class OpenHAB {
*/
static public String getVersion() {
String versionString = FrameworkUtil.getBundle(OpenHAB.class).getVersion().toString();
// if the version string contains a qualifier, remove it!
// if the version string contains a "snapshot" qualifier, remove it!
if (StringUtils.countMatches(versionString, ".") == 3) {
versionString = StringUtils.substringBeforeLast(versionString, ".");
String qualifier = StringUtils.substringAfterLast(versionString, ".");
if (StringUtils.isNumeric(qualifier) || qualifier.equals("qualifier")) {
versionString = StringUtils.substringBeforeLast(versionString, ".");
}
}
return versionString;
}