Refactoring

This commit is contained in:
Bruno Sutic 2015-07-07 18:50:55 +02:00
parent 35161668d9
commit 240a497a35
No known key found for this signature in database
GPG Key ID: 66D96E4F2F7EF26C
2 changed files with 4 additions and 3 deletions

View File

@ -1,6 +1,7 @@
# Changelog
### master
- refactor `shared_set_tpm_path_constant` function
### v2.0.0, 2015-07-07
- enable overriding default key bindings

View File

@ -7,9 +7,9 @@ SHARED_TPM_PATH=""
# sets a "global variable" for the current file
shared_set_tpm_path_constant() {
local string_path="$(tmux show-environment -g TMUX_PLUGIN_MANAGER_PATH | cut -f2 -d=)/"
# NOTE: manually expanding tilde or `$HOME` variable. Avoids using `eval` as
# described here http://stackoverflow.com/a/5748307/777337
SHARED_TPM_PATH="$(echo "$string_path" | sed "s,^\$HOME,$HOME," | sed "s,^~,$HOME,")"
# manually expanding tilde or `$HOME` variable.
string_path="${string_path/#\~/$HOME}"
SHARED_TPM_PATH="${string_path/#\$HOME/$HOME}"
}
_tmux_conf_contents() {