Skip to content

Commit

Permalink
fix(builders): #139 fix out of range error with ant
Browse files Browse the repository at this point in the history
  • Loading branch information
xizhao committed May 30, 2018
1 parent 4898773 commit ec20967
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions builders/ant.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,19 @@ func locatorFromJar(path string) (module.Locator, error) {

// fall back to parsing file name
re := regexp.MustCompile("(-sources|-javadoc)?.jar$")
rawname := strings.Split(re.ReplaceAllString(filepath.Base(path), ""), "-")
nameParts := strings.Split(re.ReplaceAllString(filepath.Base(path), ""), "-")

parsedProjectName := nameParts[0]
parsedRevisionName := ""

if len(nameParts) > 1 {
parsedRevisionName = nameParts[1]
}

return module.Locator{
Fetcher: "mvn",
Project: rawname[0],
Revision: rawname[1],
Project: parsedProjectName,
Revision: parsedRevisionName,
}, nil
}

Expand Down

0 comments on commit ec20967

Please sign in to comment.