From 37bf61ad7932c13879176af7cf01d5116c7ae077 Mon Sep 17 00:00:00 2001 From: slange-dev Date: Fri, 10 Jan 2025 02:35:05 +0100 Subject: [PATCH] Fix clean function --- CHANGELOG.md | 1 + scripts/clean_plugins.sh | 2 +- scripts/helpers/plugin_functions.sh | 3 +-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a9ce81e..1ccfaa9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ### master +- bug: fix the `clean_plugins` function and delete too many slashes, `TMUX_PLUGIN_MANAGER_PATH` default is set to `/` at the path end. ### v3.1.0, 2023-01-03 - upgrade to new version of `tmux-test` diff --git a/scripts/clean_plugins.sh b/scripts/clean_plugins.sh index a025524..b82ae60 100755 --- a/scripts/clean_plugins.sh +++ b/scripts/clean_plugins.sh @@ -16,7 +16,7 @@ clean_plugins() { local plugins plugin plugin_directory plugins="$(tpm_plugins_list_helper)" - for plugin_directory in "$(tpm_path)"/*; do + for plugin_directory in "$(tpm_path)"*; do [ -d "${plugin_directory}" ] || continue plugin="$(plugin_name_helper "${plugin_directory}")" case "${plugins}" in diff --git a/scripts/helpers/plugin_functions.sh b/scripts/helpers/plugin_functions.sh index f33d215..fc53f17 100644 --- a/scripts/helpers/plugin_functions.sh +++ b/scripts/helpers/plugin_functions.sh @@ -9,7 +9,7 @@ _manual_expansion() { } _tpm_path() { - local string_path="$(tmux start-server\; show-environment -g TMUX_PLUGIN_MANAGER_PATH | cut -f2 -d=)/" + local string_path="$(tmux start-server\; show-environment -g TMUX_PLUGIN_MANAGER_PATH | cut -f2 -d=)" _manual_expansion "$string_path" } @@ -26,7 +26,6 @@ _get_user_tmux_conf() { # Search for the correct configuration file by priority. if [ -f "$xdg_location" ]; then echo "$xdg_location" - else echo "$default_location" fi