add migrate command for migrating renamed
This commit is contained in:
		
							parent
							
								
									fa8b702c0d
								
							
						
					
					
						commit
						abf6b6f6cf
					
				
							
								
								
									
										20
									
								
								Library/Homebrew/cmd/migrate.rb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								Library/Homebrew/cmd/migrate.rb
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,20 @@
 | 
			
		||||
require "migrator"
 | 
			
		||||
require "formula_renames"
 | 
			
		||||
 | 
			
		||||
module Homebrew
 | 
			
		||||
  def migrate
 | 
			
		||||
    raise FormulaUnspecifiedError if ARGV.named.empty?
 | 
			
		||||
 | 
			
		||||
    ARGV.resolved_formulae.each do |f|
 | 
			
		||||
      if f.oldname
 | 
			
		||||
        unless (rack = HOMEBREW_CELLAR/f.oldname).exist? && !rack.subdirs.empty?
 | 
			
		||||
          raise NoSuchKegError, f.oldname
 | 
			
		||||
        end
 | 
			
		||||
        raise "#{rack} is a symlink" if rack.symlink?
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      migrator = Migrator.new(f)
 | 
			
		||||
      migrator.migrate
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user