From 43079320a29b6d44a7c2a1b7ee47557952880e45 Mon Sep 17 00:00:00 2001 From: Rustam Tagaev Date: Mon, 1 Jun 2020 20:17:41 +0300 Subject: [PATCH] #new-plugin follow Conventions --- plugins/vault-switch/vault-switch.plugin.zsh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/vault-switch/vault-switch.plugin.zsh b/plugins/vault-switch/vault-switch.plugin.zsh index ca3127f25..42a3a487f 100644 --- a/plugins/vault-switch/vault-switch.plugin.zsh +++ b/plugins/vault-switch/vault-switch.plugin.zsh @@ -3,21 +3,21 @@ add-zsh-hook precmd _restore_cache FILE_CREDENTIALS="${HOME}/.vault-switch/credentials" -function _restore_cache(){ +_restore_cache(){ [ ! -d ${HOME}/.vault-switch ] && mkdir -p ${HOME}/.vault-switch [ ! -f $FILE_CREDENTIALS ] && touch ${FILE_CREDENTIALS} source ${FILE_CREDENTIALS} } -function _get-nodes(){ +_get-nodes(){ IFS=";" read -A NODES <<< ${VAULT_NODES} } -function _set-color(){ +_set-color(){ echo "\e[1;32m$1\e[0m" } -function _list-nodes(){ +_list-nodes(){ INDEX=1 for i in ${NODES[@]} do @@ -29,7 +29,7 @@ function _list-nodes(){ done } -function _set-work-node(){ +_set-work-node(){ if [ $1 -gt ${#NODES[@]} ] then echo "Number of node not found" @@ -50,7 +50,7 @@ function _set-work-node(){ } -function vault-switch() { +vault-switch() { _get-nodes [ ! $1 ] && _list-nodes [ $1 ] && _set-work-node $1