Skip to content

Commit 8da6e96

Browse files
authored
Merge pull request #8 from eharris369/checkForMicroclimateBranchVersions
Check for Microclimate branch versions
2 parents f907136 + 5488f7f commit 8da6e96

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

dev/com.ibm.microclimate.core/src/com/ibm/microclimate/core/internal/connection/MicroclimateConnection.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
import java.util.LinkedHashMap;
2121
import java.util.List;
2222
import java.util.Map;
23+
import java.util.regex.Matcher;
24+
import java.util.regex.Pattern;
2325

2426
import org.eclipse.core.runtime.IPath;
2527
import org.eclipse.core.runtime.Path;
@@ -45,6 +47,8 @@ public class MicroclimateConnection {
4547

4648
public static final String MICROCLIMATE_WORKSPACE_PROPERTY = "com.ibm.microclimate.internal.workspace"; //$NON-NLS-1$
4749
private static final String UNKNOWN_VERSION = "unknown"; //$NON-NLS-1$
50+
private static final String BRANCH_VERSION = "\\d{4}_M\\d{1,2}_\\D";
51+
private static final Pattern pattern = Pattern.compile(BRANCH_VERSION);
4852

4953
public final URI baseUrl;
5054
public final IPath localWorkspacePath;
@@ -175,6 +179,11 @@ private static boolean isSupportedVersion(String versionStr) {
175179
// Development build - possible other values to check for?
176180
return true;
177181
}
182+
183+
Matcher matcher = pattern.matcher(versionStr);
184+
if (matcher.matches()) {
185+
return true;
186+
}
178187

179188
// The version will have a format like '1809', which corresponds to v18.09
180189
try {

0 commit comments

Comments
 (0)