console: fixup clearHistory

This commit is contained in:
Felix Lange 2017-12-08 11:56:47 +01:00
parent c79f7a46e7
commit 1225817cfc

View file

@ -217,10 +217,14 @@ func (c *Console) init(preload []string) error {
return nil
}
func (c *Console) clearHistory() (err error) {
func (c *Console) clearHistory() {
c.history = nil
c.prompter.ClearHistory()
return os.Remove(c.histPath)
if err := os.Remove(c.histPath); err != nil {
fmt.Fprintln(c.printer, "can't delete history file:", err)
} else {
fmt.Fprintln(c.printer, "history file deleted")
}
}
// consoleOutput is an override for the console.log and console.error methods to