Skip to content

Commit c1b0ef5

Browse files
committed
Fixed version extraction logic in installer.
1 parent e615f26 commit c1b0ef5

File tree

1 file changed

+2
-1
lines changed
  • installer/src/main/java/ca/weblite/jdeploy/installer

1 file changed

+2
-1
lines changed

installer/src/main/java/ca/weblite/jdeploy/installer/Main.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ private static String extractVersionFromFileName(String fileName) {
309309
if (pos < 0) return null;
310310

311311
fileName = fileName.substring(0, pos);
312-
Pattern p = Pattern.compile("\\-(\\d.*)$");
312+
Pattern p = Pattern.compile("^.*?-(\\d.*)$");
313313
Matcher m = p.matcher(fileName);
314314
if (m.matches()) {
315315
return m.group(1);
@@ -405,6 +405,7 @@ private File findInstallFilesDir(File startDir) {
405405
String version = extractVersionFromFileName(appBundle.getName());
406406
if (version == null) {
407407
System.err.println("Cannot download bundle info from network because the version string was not found in the app name: "+appBundle.getName());
408+
return null;
408409
}
409410
try {
410411
return downloadJDeployBundleForCode(code, version);

0 commit comments

Comments
 (0)