[zsh] Move Darwin $OSBUILD, $OSVERSION, and $HWMODEL
Move them from init_env_Darwin to their own functions in the new zsh/func/darwin directory.
This commit is contained in:
		
							parent
							
								
									ace2f38ed2
								
							
						
					
					
						commit
						6276b5f40e
					
				
					 5 changed files with 36 additions and 7 deletions
				
			
		
							
								
								
									
										11
									
								
								zsh/func/darwin/darwin-hardware-model
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								zsh/func/darwin/darwin-hardware-model
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,11 @@
 | 
			
		|||
# Eryn Wells <eryn@erynwells.me>
 | 
			
		||||
 | 
			
		||||
darwin-hardware-model() {
 | 
			
		||||
    if [[ -z "$darwin_hardware_model" ]]; then
 | 
			
		||||
        darwin_hardware_model=`sysctl -n hw.model`
 | 
			
		||||
    fi
 | 
			
		||||
    return "$darwin_hardware_model"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
darwin-hardware-model "$@"
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										11
									
								
								zsh/func/darwin/darwin-os-build
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								zsh/func/darwin/darwin-os-build
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,11 @@
 | 
			
		|||
#!/usr/bin/env zsh
 | 
			
		||||
# Eryn Wells <eryn@erynwells.me>
 | 
			
		||||
 | 
			
		||||
darwin-os-build() {
 | 
			
		||||
    if [[ -z "$darwin_os_build" ]]; then
 | 
			
		||||
        darwin_os_build=`sysctl -n kern.osversion`
 | 
			
		||||
    fi
 | 
			
		||||
    echo "$darwin_os_build"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
darwin-os-build "$@"
 | 
			
		||||
							
								
								
									
										11
									
								
								zsh/func/darwin/darwin-os-version
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								zsh/func/darwin/darwin-os-version
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,11 @@
 | 
			
		|||
#!/usr/bin/env zsh
 | 
			
		||||
# Eryn Wells <eryn@erynwells.me>
 | 
			
		||||
 | 
			
		||||
darwin-os-version() {
 | 
			
		||||
    if [[ -z "$darwin_os_version" ]]; then
 | 
			
		||||
        darwin_os_version=`sysctl -n kern.osproductversion`
 | 
			
		||||
    fi
 | 
			
		||||
    echo "$darwin_os_version"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
darwin-os-version "$@"
 | 
			
		||||
| 
						 | 
				
			
			@ -4,10 +4,6 @@
 | 
			
		|||
autoload append_to_path
 | 
			
		||||
autoload prepend_to_path
 | 
			
		||||
 | 
			
		||||
export OSBUILD=`sysctl -n kern.osversion`
 | 
			
		||||
export OSVERSION=`sysctl -n kern.osproductversion`
 | 
			
		||||
export HWMODEL=`sysctl -n hw.model`
 | 
			
		||||
 | 
			
		||||
export XCODE_LIBRARY="$HOME/Library/Developer/Xcode"
 | 
			
		||||
export XCODE_DERIVED_DATA="$XCODE_LIBRARY/DerivedData"
 | 
			
		||||
export XCODE_INSTALLS="$XCODE_LIBRARY/Installs"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue