mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-15 19:56:59 +08:00
30 lines
670 B
Ruby
30 lines
670 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Cask
|
|
class Cmd
|
|
# Implementation of the `brew cask cat` command.
|
|
#
|
|
# @api private
|
|
class Cat < AbstractCommand
|
|
def self.min_named
|
|
:cask
|
|
end
|
|
|
|
def self.description
|
|
"Dump raw source of a <cask> to the standard output."
|
|
end
|
|
|
|
def run
|
|
casks.each do |cask|
|
|
if Homebrew::EnvConfig.bat?
|
|
ENV["BAT_CONFIG_PATH"] = Homebrew::EnvConfig.bat_config_path
|
|
safe_system "#{HOMEBREW_PREFIX}/bin/bat", cask.sourcefile_path
|
|
else
|
|
puts File.open(cask.sourcefile_path, &:read)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|