Skip to content

Commit

Permalink
fix: syntax incorrect for tags with dashes in them
Browse files Browse the repository at this point in the history
  • Loading branch information
sagebind committed Dec 12, 2017
1 parent 166e089 commit d028083
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id 'groovy'
id 'java-gradle-plugin'
id 'maven-publish'
id 'com.widen.versioning' version '0.1.0'
id 'com.widen.versioning' version '0.2.0'
}

group 'widen'
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/widen/versioning/VersionGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static String generateFromString(String describe, Settings settings) {
return null;
}

String version = describe.replaceFirst("-", "+");
String version = describe.replaceFirst("-(\\d+-g.)", "+$1");

if (settings.tagPrefix != null && version.startsWith(settings.tagPrefix)) {
version = version.substring(settings.tagPrefix.length());
Expand Down

0 comments on commit d028083

Please sign in to comment.