mirror of
				https://github.com/tmux-plugins/tpm.git
				synced 2025-11-04 08:36:05 +00:00 
			
		
		
		
	Run all *.tmux plugin files as executables
This commit is contained in:
		@@ -1,4 +1,7 @@
 | 
			
		||||
# Changelog
 | 
			
		||||
 | 
			
		||||
### master
 | 
			
		||||
- run all *.tmux plugin files as executables
 | 
			
		||||
 | 
			
		||||
### v0.0.1, 2014-05-21
 | 
			
		||||
- get TPM up and running
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user