Run all *.tmux plugin files as executables

This commit is contained in:
Bruno Sutic committed 2014-05-22 12:32:00 +02:00
1 parent aee1fbc949
commit c897f36e3d
2 files changed
+9 -4

No files matched your search

+6 -4
View File
@@ -4,13 +4,15 @@ CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "$CURRENT_DIR/shared_functions.sh"
# Sources all *.tmux files from the plugin directory.
# Files are sourced as tmux config files, not as shell scripts!
# Runs all *.tmux files from the plugin directory.
# Files are ran as executables.
# No errors if the plugin dir does not exist.
silently_source_all_tmux_files() {
local plugin_path=$1
for tmux_file in $plugin_path/*.tmux; do
tmux run-shell "source-file $tmux_file 2>&1 1>&/dev/null"
local plugin_tmux_files="$plugin_path*.tmux"
for tmux_file in $plugin_tmux_files; do
# runs *.tmux file as an executable
$tmux_file 2>&1 1>&/dev/null
done
}