aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/keyringer/completions/bash/keyringer7
-rw-r--r--lib/keyringer/completions/zsh/_keyringer7
2 files changed, 13 insertions, 1 deletions
diff --git a/lib/keyringer/completions/bash/keyringer b/lib/keyringer/completions/bash/keyringer
index 4459b34..e33977a 100644
--- a/lib/keyringer/completions/bash/keyringer
+++ b/lib/keyringer/completions/bash/keyringer
@@ -44,11 +44,16 @@ _keyringer() {
# Initial options
config="$HOME/.keyringer"
- keyrings="`ls $config | sed -e 's/config//'`"
+
+ # Check if we have initial configuration
+ if [ ! -d "$config" ]; then
+ return
+ fi
# Process config
source $config/config
path="`eval echo '$'$instance`"
+ keyrings="`ls $config | sed -e 's/config//'`"
# Available instances
instances="`echo $keyrings | sed -e 's/ /|/'`"
diff --git a/lib/keyringer/completions/zsh/_keyringer b/lib/keyringer/completions/zsh/_keyringer
index 3aba2b3..b8f9d31 100644
--- a/lib/keyringer/completions/zsh/_keyringer
+++ b/lib/keyringer/completions/zsh/_keyringer
@@ -33,6 +33,13 @@ _keyringer() {
# Initial options
local config="$HOME/.keyringer"
+
+ # Check if we have initial configuration
+ if [ ! -d "$config" ]; then
+ return
+ fi
+
+ # Process config
local keyrings="`ls $config | sed -e 's/config//'`"
_arguments \