Refactor 'tpm' script

This commit is contained in:
Bruno Sutic 2015-08-03 15:20:40 +02:00
parent 169e1b2e88
commit 79d90f90f7
No known key found for this signature in database
GPG Key ID: 66D96E4F2F7EF26C
2 changed files with 11 additions and 11 deletions

View File

@ -1,10 +0,0 @@
get_tmux_option() {
local option="$1"
local default_value="$2"
local option_value="$(tmux show-option -gqv "$option")"
if [ -z "$option_value" ]; then
echo "$default_value"
else
echo "$option_value"
fi
}

12
tpm
View File

@ -5,7 +5,17 @@ BINDINGS_DIR="$CURRENT_DIR/bindings"
SCRIPTS_DIR="$CURRENT_DIR/scripts"
source "$SCRIPTS_DIR/variables.sh"
source "$SCRIPTS_DIR/helpers.sh"
get_tmux_option() {
local option="$1"
local default_value="$2"
local option_value="$(tmux show-option -gqv "$option")"
if [ -z "$option_value" ]; then
echo "$default_value"
else
echo "$option_value"
fi
}
tpm_path_set() {
tmux show-environment -g "$DEFAULT_TPM_ENV_VAR_NAME" >/dev/null 2>&1