Browse Source
Merge pull request #2127 from nagy/check-history-error
Check for history file errors as well
pull/2128/head
Chris Lu
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
4 additions and
2 deletions
-
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() |
|
|
|
} |
|
|
|
} |