| 
									
										
										
										
											2024-04-01 09:53:38 -07:00
										 |  |  | # typed: strict | 
					
						
							| 
									
										
										
										
											2019-04-19 15:38:03 +09:00
										 |  |  | # frozen_string_literal: true | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-04-01 09:53:38 -07:00
										 |  |  | require "abstract_command" | 
					
						
							| 
									
										
										
										
											2015-04-13 18:16:27 +08:00
										 |  |  | require "sandbox" | 
					
						
							| 
									
										
										
										
											2018-05-12 13:52:40 +02:00
										 |  |  | require "formula_installer" | 
					
						
							| 
									
										
										
										
											2015-04-13 18:16:27 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-06-18 22:41:47 -05:00
										 |  |  | module Homebrew | 
					
						
							| 
									
										
										
										
											2024-04-01 09:53:38 -07:00
										 |  |  |   module Cmd | 
					
						
							|  |  |  |     class Postinstall < AbstractCommand | 
					
						
							|  |  |  |       cmd_args do | 
					
						
							|  |  |  |         description <<~EOS | 
					
						
							|  |  |  |           Rerun the post-install steps for <formula>. | 
					
						
							|  |  |  |         EOS | 
					
						
							| 
									
										
										
										
											2016-09-26 01:44:51 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-04-01 09:53:38 -07:00
										 |  |  |         named_args :installed_formula, min: 1
 | 
					
						
							|  |  |  |       end | 
					
						
							| 
									
										
										
										
											2018-11-11 20:17:33 +05:30
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-04-01 09:53:38 -07:00
										 |  |  |       sig { override.void } | 
					
						
							|  |  |  |       def run | 
					
						
							|  |  |  |         args.named.to_resolved_formulae.each do |f| | 
					
						
							|  |  |  |           ohai "Postinstalling #{f}" | 
					
						
							|  |  |  |           f.install_etc_var | 
					
						
							|  |  |  |           if f.post_install_defined? | 
					
						
							|  |  |  |             fi = FormulaInstaller.new(f, **{ debug: args.debug?, quiet: args.quiet?, verbose: args.verbose? }.compact) | 
					
						
							|  |  |  |             fi.post_install | 
					
						
							|  |  |  |           else | 
					
						
							|  |  |  |             opoo "#{f}: no `post_install` method was defined in the formula!" | 
					
						
							|  |  |  |           end | 
					
						
							|  |  |  |         end | 
					
						
							| 
									
										
										
										
											2023-06-22 03:06:45 +01:00
										 |  |  |       end | 
					
						
							| 
									
										
										
										
											2015-04-13 18:16:27 +08:00
										 |  |  |     end | 
					
						
							| 
									
										
										
										
											2013-09-01 13:56:35 +01:00
										 |  |  |   end | 
					
						
							|  |  |  | end |