mirror of
https://github.com/tmux-plugins/tpm.git
synced 2024-10-31 15:18:52 +00:00
44 lines
1.1 KiB
Bash
Executable File
44 lines
1.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
HELPERS_DIR="$CURRENT_DIR/helpers"
|
|
|
|
source "$HELPERS_DIR/plugin_functions.sh"
|
|
source "$HELPERS_DIR/utility.sh"
|
|
|
|
if [ "$1" == "--tmux-echo" ]; then # tmux-specific echo functions
|
|
source "$HELPERS_DIR/tmux_echo_functions.sh"
|
|
else # shell output functions
|
|
source "$HELPERS_DIR/shell_echo_functions.sh"
|
|
fi
|
|
|
|
clean_plugins() {
|
|
local plugins plugin plugin_directory
|
|
plugins="$(tpm_plugins_list_helper)"
|
|
|
|
for plugin_directory in "$(tpm_path)"/*; do
|
|
[ -d "${plugin_directory}" ] || continue
|
|
plugin="$(plugin_name_helper "${plugin_directory}")"
|
|
case "${plugins}" in
|
|
*"${plugin}"*) : ;;
|
|
*)
|
|
[ "${plugin}" = "tpm" ] && continue
|
|
echo_ok "Removing \"$plugin\""
|
|
rm -rf "${plugin_directory}" >/dev/null 2>&1
|
|
[ -d "${plugin_directory}" ] &&
|
|
echo_err " \"$plugin\" clean fail" ||
|
|
echo_ok " \"$plugin\" clean success"
|
|
;;
|
|
esac
|
|
done
|
|
}
|
|
|
|
main() {
|
|
set_long_tmux_display_time
|
|
ensure_tpm_path_exists
|
|
clean_plugins
|
|
tmux set-option -g display-time "$org_display_time" # Restore display-time
|
|
exit_value_helper
|
|
}
|
|
main
|