diff --git a/CHANGELOG.md b/CHANGELOG.md index cc4e29f..9ffa4c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/scripts/shared_functions.sh b/scripts/shared_functions.sh index a834ffb..efa9e89 100644 --- a/scripts/shared_functions.sh +++ b/scripts/shared_functions.sh @@ -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() {