Check if homebrew is installed before making functions for it
This commit is contained in:
		
							parent
							
								
									cfaae7e2a7
								
							
						
					
					
						commit
						fc21785264
					
				
							
								
								
									
										39
									
								
								zsh/lib/os
									
									
									
									
									
								
							
							
						
						
									
										39
									
								
								zsh/lib/os
									
									
									
									
									
								
							|  | @ -12,17 +12,38 @@ function is_linux { | |||
| 
 | ||||
| if is_mac; then | ||||
| 
 | ||||
|     function pkg_install() { | ||||
|         brew install $1 | ||||
|     } | ||||
|     if command_exists brew; then | ||||
| 
 | ||||
|     function pkg_remove() { | ||||
|         brew remove $1 | ||||
|     } | ||||
|         function pkg_install() { | ||||
|             brew install $1 | ||||
|         } | ||||
| 
 | ||||
|     function pkg_update() { | ||||
|         brew update && brew upgrade | ||||
|     } | ||||
|         function pkg_remove() { | ||||
|             brew remove $1 | ||||
|         } | ||||
| 
 | ||||
|         function pkg_update() { | ||||
|             brew update && brew upgrade | ||||
|         } | ||||
| 
 | ||||
|     else | ||||
|      | ||||
|         function pkg_install() { | ||||
|             echo_r "Homebrew not installed" | ||||
|             exit 1 | ||||
|         } | ||||
| 
 | ||||
|         function pkg_remove() { | ||||
|             echo_r "Homebrew not installed" | ||||
|             exit 1 | ||||
|         } | ||||
| 
 | ||||
|         function pkg_update() { | ||||
|             echo_r "Homebrew not installed" | ||||
|             exit 1 | ||||
|         } | ||||
| 
 | ||||
|     fi | ||||
| 
 | ||||
| elif is_deb; then | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue