Skip to content

Commit

Permalink
trim newlines on version number
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias Meinhardt committed Mar 19, 2019
1 parent 48e362e commit 628c351
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/cli/cmd/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package cmd
import (
"fmt"

"github.com/meinto/git-semver"
semver "github.com/meinto/git-semver"
"github.com/meinto/git-semver/file"
"github.com/meinto/git-semver/git"
"github.com/meinto/git-semver/pkg/cli/cmd/internal"
Expand Down
4 changes: 4 additions & 0 deletions version.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ func (v *version) Get(vt string) (string, error) {

numbers := strings.Split(v.current, ".")

for i, n := range numbers {
numbers[i] = strings.TrimSuffix(n, "\n")
}

var err error
switch versionType {
case MAJOR:
Expand Down

0 comments on commit 628c351

Please sign in to comment.