2014-05-18 18:35:55 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
|
|
|
|
source "$CURRENT_DIR/shared_functions.sh"
|
|
|
|
|
2014-05-22 06:26:04 -04:00
|
|
|
# Runs all *.tmux files from the plugin directory.
|
|
|
|
# Files are ran as executables.
|
2014-05-18 18:35:55 -04:00
|
|
|
# No errors if the plugin dir does not exist.
|
|
|
|
silently_source_all_tmux_files() {
|
2014-05-24 17:15:13 -04:00
|
|
|
local plugin_path=$1
|
|
|
|
local plugin_tmux_files="$plugin_path*.tmux"
|
|
|
|
for tmux_file in $plugin_tmux_files; do
|
|
|
|
# runs *.tmux file as an executable
|
|
|
|
$tmux_file >/dev/null 2>&1
|
|
|
|
done
|
2014-05-18 18:35:55 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
source_plugin() {
|
2014-05-24 17:15:13 -04:00
|
|
|
local plugin=$1
|
|
|
|
local plugin_path=$(shared_plugin_path "$plugin")
|
|
|
|
silently_source_all_tmux_files "$plugin_path"
|
2014-05-18 18:35:55 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
source_plugins() {
|
2014-05-24 17:15:13 -04:00
|
|
|
local plugins=$(shared_get_tpm_plugins_list)
|
|
|
|
for plugin in $plugins; do
|
|
|
|
source_plugin "$plugin"
|
|
|
|
done
|
2014-05-18 18:35:55 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
main() {
|
2014-05-24 17:15:13 -04:00
|
|
|
shared_set_tpm_path_constant
|
|
|
|
source_plugins
|
2014-05-18 18:35:55 -04:00
|
|
|
}
|
|
|
|
main
|