Manually expand tilde and $HOME in TMUX_SHARED_MANAGER_PATH

Tilde char and `$HOME` in `TMUX_SHARED_MANAGER_PATH` couldn't be used because
they are just plain strings. Fixing the problem by manually expanding them.
This commit is contained in:
Bruno Sutic 2014-10-25 15:45:04 +02:00
parent 804a90707c
commit 27d7cbd6b3
No known key found for this signature in database
GPG Key ID: 66D96E4F2F7EF26C
2 changed files with 6 additions and 1 deletions

View File

@ -4,6 +4,8 @@
- if the plugin is not downloaded do not source it
- remove `PLUGINS.md`, an obsolete list of plugins
- update readme with instructions about uninstalling plugins
- tilde char and `$HOME` in `TMUX_SHARED_MANAGER_PATH` couldn't be used because
they are just plain strings. Fixing the problem by manually expanding them.
### v1.0.0, 2014-08-05
- update readme because of github organization change to

View File

@ -5,7 +5,10 @@ SHARED_TPM_PATH=""
# sets a "global variable" for the current file
shared_set_tpm_path_constant() {
SHARED_TPM_PATH=$(tmux show-environment -g TMUX_PLUGIN_MANAGER_PATH | cut -f2 -d=)
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,")"
}
shared_get_tpm_plugins_list() {