[zsh] Move the hello message to its own Darwin-specific say_hello function
This commit is contained in:
		
							parent
							
								
									edf8034308
								
							
						
					
					
						commit
						3addd3d3a2
					
				
					 2 changed files with 15 additions and 8 deletions
				
			
		| 
						 | 
				
			
			@ -5,11 +5,5 @@ if ssh-add --apple-load-keychain; then
 | 
			
		|||
    echo
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
if binary_exists sw_vers; then
 | 
			
		||||
    cat_program=cat
 | 
			
		||||
    if binary_exists lolcat; then
 | 
			
		||||
        cat_program=lolcat
 | 
			
		||||
    fi
 | 
			
		||||
    print "It's `date +'%H:%M on %A, %B %d'`.\nThis machine is a $HWMODEL.\nYou're running macOS $OSVERSION.\n" | $cat_program
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
autoload -Uz init_profile_darwin_say_hello
 | 
			
		||||
init_profile_darwin_say_hello
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										13
									
								
								zsh/func/init_profile_darwin_say_hello
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								zsh/func/init_profile_darwin_say_hello
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,13 @@
 | 
			
		|||
#!/usr/bin/env zsh
 | 
			
		||||
# Eryn Wells <eryn@erynwells.me>
 | 
			
		||||
 | 
			
		||||
if binary_exists sw_vers && [[ -n "$HWMODEL" && -n "$OSVERSION" ]]; then
 | 
			
		||||
    cat_program=cat
 | 
			
		||||
    if binary_exists lolcat; then
 | 
			
		||||
        cat_program=lolcat
 | 
			
		||||
    fi
 | 
			
		||||
    print "It's `date +'%H:%M on %A, %B %d'`.\nThis machine is a $HWMODEL.\nYou're running macOS $OSVERSION.\n" | $cat_program
 | 
			
		||||
    return 0
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
return 1
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue