Skip to content
Snippets Groups Projects
Commit 66d564d8 authored by Mike McQuaid's avatar Mike McQuaid
Browse files

update-report: tweak Cask migration output.

No longer output every cask under the list of changed formulae but
instead create a dedicated, unprinted report section for casks and then
iterate through that instead.
parent 3f505fe6
No related branches found
No related tags found
No related merge requests found
......@@ -193,7 +193,16 @@ class Reporter
dst = Pathname.new paths.last
next unless dst.extname == ".rb"
next unless paths.any? { |p| tap.formula_file?(p) || tap.cask_file?(p)}
if paths.any? { |p| tap.cask_file?(p) }
# Currently only need to handle Cask deletion/migration.
if status == "D"
# Have a dedicated report array for deleted casks.
@report[:DC] << tap.formula_file_to_name(src)
end
end
next unless paths.any? { |p| tap.formula_file?(p) }
case status
when "A", "D"
......@@ -247,12 +256,13 @@ class Reporter
end
def migrate_tap_migration
report[:D].each do |full_name|
(report[:D] + report[:DC]).each do |full_name|
name = full_name.split("/").last
new_tap_name = tap.tap_migrations[name]
next if new_tap_name.nil? # skip if not in tap_migrations list.
if tap == "caskroom/cask"
# This means it is a Cask
if report[:DC].include? full_name
next unless (HOMEBREW_REPOSITORY/"Caskroom"/name).exist?
new_tap = Tap.fetch(new_tap_name)
new_tap.install unless new_tap.installed?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment