Refactor 'source_plugins' script
This commit is contained in:
parent
5adc9a987f
commit
169e1b2e88
1 changed files with 4 additions and 8 deletions
|
@ -12,7 +12,7 @@ plugin_dir_exists() {
|
||||||
# Files are ran as executables.
|
# Files are ran as executables.
|
||||||
# No errors if the plugin dir does not exist.
|
# No errors if the plugin dir does not exist.
|
||||||
silently_source_all_tmux_files() {
|
silently_source_all_tmux_files() {
|
||||||
local plugin_path=$1
|
local plugin_path="$1"
|
||||||
local plugin_tmux_files="$plugin_path*.tmux"
|
local plugin_tmux_files="$plugin_path*.tmux"
|
||||||
if plugin_dir_exists "$plugin_path"; then
|
if plugin_dir_exists "$plugin_path"; then
|
||||||
for tmux_file in $plugin_tmux_files; do
|
for tmux_file in $plugin_tmux_files; do
|
||||||
|
@ -25,16 +25,12 @@ silently_source_all_tmux_files() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
source_plugin() {
|
|
||||||
local plugin=$1
|
|
||||||
local plugin_path="$(shared_plugin_path "$plugin")"
|
|
||||||
silently_source_all_tmux_files "$plugin_path"
|
|
||||||
}
|
|
||||||
|
|
||||||
source_plugins() {
|
source_plugins() {
|
||||||
|
local plugin plugin_path
|
||||||
local plugins="$(shared_get_tpm_plugins_list)"
|
local plugins="$(shared_get_tpm_plugins_list)"
|
||||||
for plugin in $plugins; do
|
for plugin in $plugins; do
|
||||||
source_plugin "$plugin"
|
plugin_path="$(shared_plugin_path "$plugin")"
|
||||||
|
silently_source_all_tmux_files "$plugin_path"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue