Skip to content

Commit

Permalink
Merge pull request #1836 from hawson/fix-1760-history_file
Browse files Browse the repository at this point in the history
Fix for #1760:  influx doesn't create $HOME/.influx_history
  • Loading branch information
otoolep committed Mar 3, 2015
2 parents cd18255 + 0f7c69c commit adee51c
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions cmd/influx/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,18 @@ func main() {
if e != nil {
break
}
if !c.ParseCommand(l) {
if c.ParseCommand(l) {
// write out the history
if f, err := os.Create(historyFile); err == nil {
c.Line.WriteHistory(f)
f.Close()
if len(historyFile) > 0 {
c.Line.AppendHistory(l)
if f, err := os.Create(historyFile); err == nil {
c.Line.WriteHistory(f)
f.Close()
}
}
break
} else {
break // exit main loop
}
c.Line.AppendHistory(l)
}
}

Expand Down

0 comments on commit adee51c

Please sign in to comment.