how to set ENV for formula install
This commit is contained in:
		
							parent
							
								
									e1b988770a
								
							
						
					
					
						commit
						b193564050
					
				@ -757,6 +757,8 @@ Firstly, the overall environment in which Homebrew runs is filtered to avoid env
 | 
			
		||||
 | 
			
		||||
The second level of filtering removes sensitive environment variables (such as credentials like keys, passwords or tokens) to avoid malicious subprocesses obtaining them (<https://github.com/Homebrew/brew/pull/2524>). This has the effect of preventing any such variables from reaching a formula's Ruby code as they are filtered before it is called. The specific implementation can be seen in the [`ENV.clear_sensitive_environment!` method](https://github.com/Homebrew/brew/blob/HEAD/Library/Homebrew/extend/ENV.rb).
 | 
			
		||||
 | 
			
		||||
You can set environment variables in a formula's `install` method using `ENV["VARIABLE_NAME"] = "VALUE"`. An example can be seen in [the `gh` formula](https://github.com/Homebrew/homebrew-core/blob/fd9ad29f8e3ca9476f838ebb13794ddb7dafba00/Formula/gh.rb#L22).
 | 
			
		||||
 | 
			
		||||
In summary, environment variables used by a formula need to conform to these filtering rules in order to be available.
 | 
			
		||||
 | 
			
		||||
## Updating formulae
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user