mirror of
				https://github.com/ohmyzsh/ohmyzsh.git
				synced 2024-05-11 05:55:17 +00:00 
			
		
		
		
	ssh-agent: check if ssh-add -l was successful
				
					
				
			This commit is contained in:
		@@ -12,7 +12,7 @@ function _start_agent() {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function _add_identities() {
 | 
			
		||||
	local id line sig
 | 
			
		||||
	local id line sig lines
 | 
			
		||||
	local -a identities loaded_sigs loaded_ids not_loaded
 | 
			
		||||
	zstyle -a :omz:plugins:ssh-agent identities identities
 | 
			
		||||
 | 
			
		||||
@@ -32,10 +32,12 @@ function _add_identities() {
 | 
			
		||||
	fi
 | 
			
		||||
 | 
			
		||||
	# get list of loaded identities' signatures and filenames
 | 
			
		||||
	for line in ${(f)"$(ssh-add -l)"}; do
 | 
			
		||||
		loaded_sigs+=${${(z)line}[2]}
 | 
			
		||||
		loaded_ids+=${${(z)line}[3]}
 | 
			
		||||
	done
 | 
			
		||||
	if lines=$(ssh-add -l); then
 | 
			
		||||
		for line in ${(f)lines}; do
 | 
			
		||||
			loaded_sigs+=${${(z)line}[2]}
 | 
			
		||||
			loaded_ids+=${${(z)line}[3]}
 | 
			
		||||
		done
 | 
			
		||||
	fi
 | 
			
		||||
 | 
			
		||||
	# add identities if not already loaded
 | 
			
		||||
	for id in $identities; do
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user