Skip to content

Commit

Permalink
Fixed a buggy
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramon Smit committed Apr 20, 2018
1 parent bfdc64a commit 270b535
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ VET_REPORT = vet.report
TEST_REPORT = tests.xml
GOARCH = amd64

VERSION?=1.2.2
VERSION?=1.2.3

COMMIT=$(shell git rev-parse HEAD)
BRANCH=$(shell git rev-parse --abbrev-ref HEAD)
Expand Down
11 changes: 9 additions & 2 deletions src/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ func askVersion() string {
var re = regexp.MustCompile(`\#\#\s(?P<major>\d+).(?P<minor>\d+).(?P<hotfix>\d+)\s\((?P<year>\d+)-(?P<month>\d+)-(?P<day>\d+)\)`)
b, _ := ioutil.ReadFile(ChangelogFile())
text := ""
name := ""

if len(b) > 0 {
str := string(b)
Expand All @@ -226,8 +225,14 @@ func askVersion() string {
newHotfixVersion := (1 + hotfix)

name := m["major"] + "." + m["minor"] + "." + strconv.Itoa(int(newHotfixVersion))

fmt.Print(ASK_VERSION+" [next in increment is '", name, "']: ")
text, _ = reader.ReadString('\n')

if len(text) < 3 {
text = name
}

} else {
reader := bufio.NewReader(os.Stdin)
fmt.Print(ASK_VERSION + ":")
Expand All @@ -238,9 +243,11 @@ func askVersion() string {
text = strings.Replace(text, "\n", "", -1)

if len(text) < 3 {
text = name
panic("No version number found!")
}

AskedQuestions = append(AskedQuestions, questions{ASK_VERSION, text})

return text
}

Expand Down

0 comments on commit 270b535

Please sign in to comment.