File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import (
1010 "time"
1111)
1212
13- const _VERSION = "0.2.1 "
13+ const _VERSION = "0.2.2 "
1414
1515func Version () string {
1616 return _VERSION
@@ -49,18 +49,18 @@ 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-
5952 fields := strings .Fields (stdout )
6053 if len (fields ) < 3 {
6154 return "" , fmt .Errorf ("not enough output: %s" , stdout )
6255 }
6356
57+ // Handle special case on Windows.
58+ i := strings .Index (fields [2 ], "windows" )
59+ if i >= 1 {
60+ gitVersion = fields [2 ][:i - 1 ]
61+ return gitVersion , nil
62+ }
63+
6464 gitVersion = fields [2 ]
6565 return gitVersion , nil
6666}
You can’t perform that action at this time.
0 commit comments