From 43ad0ca852e7aa766456773671101541374f43c5 Mon Sep 17 00:00:00 2001 From: Karl Fischer Date: Sat, 27 Feb 2021 12:40:28 +0100 Subject: [PATCH] Fix caching behavior --- CHANGELOG.md | 10 ++++++++++ completer/completer.go | 3 ++- main.go | 4 ++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d76d7c3..45908ba7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,16 @@ ## master - unreleased +## v0.11.0 (February 27, 2021) + +ENHANCEMENTS: + +* Adding dry-run/confirm flags to the `add` command ([#91](https://github.com/fishi0x01/vsh/pull/91) - Thank you for implementation [dugshnay](https://github.com/dugshnay)) + +BUG FIXES: + +* Fix stale cache in interactive mode ([#92](https://github.com/fishi0x01/vsh/pull/92)) + ## v0.10.0 (February 24, 2021) ENHANCEMENTS: diff --git a/completer/completer.go b/completer/completer.go index a2de4635..edb82685 100644 --- a/completer/completer.go +++ b/completer/completer.go @@ -58,7 +58,8 @@ func (c *Completer) absolutePathSuggestions(arg string) (result []prompt.Suggest options, err = c.client.List(queryPath) if err != nil { - panic(err) + log.UserError("Error during auto-completion: %s", err) + return result } options = append(options, "../") diff --git a/main.go b/main.go index 60bb3921..e05b5b35 100644 --- a/main.go +++ b/main.go @@ -40,8 +40,8 @@ func (args) Description() string { func executor(in string) { // Every command can change the vault content - // i.e., the cache should be cleared on command execution - vaultClient.ClearCache() + // i.e., the cache should be cleared after a command got executed + defer vaultClient.ClearCache() // Split the input separate the command and the arguments. in = strings.TrimSpace(in)