Skip to content

Commit

Permalink
fix: try fix path handler in windows
Browse files Browse the repository at this point in the history
  • Loading branch information
axetroy committed Dec 4, 2020
1 parent 5050ea4 commit a9c32a6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/client/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ import (
)

var (
versionRegexp = regexp.MustCompile(`^v`)
versionRegexp = regexp.MustCompile(`^v`)
winAbsolutePathRegegp = regexp.MustCompile(`^(?i)[a-z]:\.+`)
)

type Tag struct {
Expand All @@ -38,7 +39,7 @@ func NewGitClient(dir string) (*GitClient, error) {
return nil, errors.WithStack(err)
}

if !path.IsAbs(dir) {
if !path.IsAbs(dir) && !winAbsolutePathRegegp.MatchString(dir) {
dir = path.Join(cwd, dir)
}

Expand Down

0 comments on commit a9c32a6

Please sign in to comment.