From 5fc404783e26ac3a7de66b5e81aeca5390753c7f Mon Sep 17 00:00:00 2001 From: jolheiser Date: Sun, 20 Aug 2023 21:04:36 -0500 Subject: [PATCH] fix: mkdirall and nushell comments Signed-off-by: jolheiser --- contrib/kv-completions.nu | 4 ++++ main.go | 3 +++ 2 files changed, 7 insertions(+) diff --git a/contrib/kv-completions.nu b/contrib/kv-completions.nu index b529e09..cb72f24 100644 --- a/contrib/kv-completions.nu +++ b/contrib/kv-completions.nu @@ -2,11 +2,13 @@ def keys [] { ^kv list | lines | each { |line| $line | str trim } } +# Get a value export extern "kv get" [ key: string@keys # Key --store(-s) # Use a specific store instead of aggregate ] +# Set a value export extern "kv set" [ key: string # Key value: string # Value @@ -14,11 +16,13 @@ export extern "kv set" [ --store(-s) # Store for this key/value ] +# Delete a value export extern "kv del" [ key: string@keys # Key --store(-s) # Store for this key/value ] +# List keys and values export extern "kv list" [ prefix?: string # Key prefix filter --store(-s) # Use a specific store instead of aggregate diff --git a/main.go b/main.go index 7ba73d9..242c351 100644 --- a/main.go +++ b/main.go @@ -261,6 +261,9 @@ func (a *app) load() (store, error) { if !errors.Is(err, fs.ErrNotExist) { return nil, err } + if err := os.MkdirAll(*a.storeLocation, os.ModePerm); err != nil { + return nil, err + } fi, err := os.Create(defaultConfig) if err != nil { return nil, err