mirror of
				https://github.com/tmux-plugins/tpm.git
				synced 2025-11-04 00:16:05 +00:00 
			
		
		
		
	add bundle style plugin definition
This commit is contained in:
		
				
					committed by
					
						
						Bruno Sutic
					
				
			
			
				
	
			
			
			
						parent
						
							824906ffa5
						
					
				
				
					commit
					445be1eede
				
			@@ -12,7 +12,15 @@ shared_set_tpm_path_constant() {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
shared_get_tpm_plugins_list() {
 | 
			
		||||
	tmux show-option -gqv "$tpm_plugins_variable_name"
 | 
			
		||||
	local plugins_list
 | 
			
		||||
	plugins_list="$(tmux show-option -gqv "$tpm_plugins_variable_name")"
 | 
			
		||||
	if [ -z "${plugins_list}" ]; then
 | 
			
		||||
		#read set @plugin "tmux-plugins/tmux-example-plugin" entries
 | 
			
		||||
		cat /etc/tmux.conf ~/.tmux.conf 2>/dev/null |
 | 
			
		||||
			awk '/^set +@plugin/ { gsub(/'\''/,""); gsub(/'\"'/,""); print $3 }'
 | 
			
		||||
	else
 | 
			
		||||
		printf "%s\\n" "${plugins_list}"
 | 
			
		||||
	fi
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# Allowed plugin name formats:
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										28
									
								
								tests/test_plugin_bundle_installation.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										28
									
								
								tests/test_plugin_bundle_installation.sh
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,28 @@
 | 
			
		||||
#!/usr/bin/env bash
 | 
			
		||||
 | 
			
		||||
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 | 
			
		||||
 | 
			
		||||
source $CURRENT_DIR/helpers.sh
 | 
			
		||||
 | 
			
		||||
test_plugin_installation() {
 | 
			
		||||
	set_tmux_conf_helper <<- HERE
 | 
			
		||||
	set @plugin "tmux-plugins/tmux-example-plugin"
 | 
			
		||||
	run-shell "$PWD/tpm"
 | 
			
		||||
	HERE
 | 
			
		||||
 | 
			
		||||
	# opens tmux and test it with `expect`
 | 
			
		||||
	"$CURRENT_DIR"/expect_successful_plugin_download ||
 | 
			
		||||
		fail_helper "Tmux plugin installation fails"
 | 
			
		||||
 | 
			
		||||
	# check plugin dir exists after download
 | 
			
		||||
	check_dir_exists_helper "$HOME/.tmux/plugins/tmux-example-plugin/" ||
 | 
			
		||||
		fail_helper "Plugin download fails"
 | 
			
		||||
 | 
			
		||||
	teardown_helper
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
main() {
 | 
			
		||||
	test_plugin_installation
 | 
			
		||||
	exit_value_helper
 | 
			
		||||
}
 | 
			
		||||
main
 | 
			
		||||
		Reference in New Issue
	
	Block a user