diff options
| author | Daniel Nagy <danielnagy@posteo.de> | 2021-06-08 11:01:23 +0200 |
|---|---|---|
| committer | Daniel Nagy <danielnagy@posteo.de> | 2021-06-08 11:14:49 +0200 |
| commit | 7ce3bee0c005081dd158ad237c69e9883bf11a3a (patch) | |
| tree | 75d79edc8b89dbfdba60d29707c6a28fbe5a3d93 | |
| parent | 492a91e0b09d0f4f2d673fb73ecc0568eaee4785 (diff) | |
| download | seaweedfs-7ce3bee0c005081dd158ad237c69e9883bf11a3a.tar.xz seaweedfs-7ce3bee0c005081dd158ad237c69e9883bf11a3a.zip | |
Check for history file errors as well
| -rw-r--r-- | weed/shell/shell_liner.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/weed/shell/shell_liner.go b/weed/shell/shell_liner.go index 38b74bc54..765b0efda 100644 --- a/weed/shell/shell_liner.go +++ b/weed/shell/shell_liner.go @@ -148,9 +148,11 @@ func loadHistory() { func saveHistory() { if f, err := os.Create(historyPath); err != nil { - fmt.Printf("Error writing history file: %v\n", err) + fmt.Printf("Error creating history file: %v\n", err) } else { - line.WriteHistory(f) + if _, err = line.WriteHistory(f); err != nil { + fmt.Printf("Error writing history file: %v\n", err) + } f.Close() } } |
