Skip to content

Commit 3835dd7

Browse files
committed
Handle windows case
1 parent 1ffc4bc commit 3835dd7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

git.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"time"
1111
)
1212

13-
const _VERSION = "0.1.0"
13+
const _VERSION = "0.1.1"
1414

1515
func Version() string {
1616
return _VERSION
@@ -49,6 +49,13 @@ func BinVersion() (string, error) {
4949
return "", err
5050
}
5151

52+
// Handle special case on Windows.
53+
i := strings.Index(stdout, "windows")
54+
if i >= 1 {
55+
gitVersion = stdout[:i-1]
56+
return gitVersion, nil
57+
}
58+
5259
fields := strings.Fields(stdout)
5360
if len(fields) < 3 {
5461
return "", fmt.Errorf("not enough output: %s", stdout)

0 commit comments

Comments
 (0)