brew/Library/Homebrew/bundle/whalebrew_dumper.rb
Mike McQuaid c9a7b62b1d
Homebrew 4.5 deprecations/disables/removals
The usual cycle of deprecating, disabling, and removing things in
Homebrew major/minor releases.
2025-04-22 17:15:23 +01:00

27 lines
779 B
Ruby

# typed: true # rubocop:todo Sorbet/StrictSigil
# frozen_string_literal: true
module Homebrew
module Bundle
module WhalebrewDumper
def self.reset!
@images = nil
end
def self.images
return [] unless Bundle.whalebrew_installed?
odeprecated "`brew bundle` `whalebrew` support", "using `whalebrew` directly"
@images ||= `whalebrew list 2>/dev/null`.split("\n")
.reject { |line| line.start_with?("COMMAND ") }
.map { |line| line.split(/\s+/).last }
.uniq
end
def self.dump
images.map { |image| "whalebrew \"#{image}\"" }.join("\n")
end
end
end
end