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.
This commit is contained in:
parent
3f505fe642
commit
66d564d885
@ -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?
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user