36 lines
822 B
Ruby
Raw Normal View History

2020-11-25 17:03:23 +01:00
# typed: strict
# frozen_string_literal: true
2018-09-06 08:29:14 +02:00
module Cask
2018-09-04 08:45:48 +01:00
class Cmd
2020-08-19 10:34:07 +02:00
# Implementation of the `brew cask cat` command.
#
# @api private
2017-05-20 19:08:03 +02:00
class Cat < AbstractCommand
2020-10-20 12:03:48 +02:00
extend T::Sig
sig { override.returns(T.nilable(T.any(Integer, Symbol))) }
2020-08-01 02:30:46 +02:00
def self.min_named
:cask
end
2020-10-20 12:03:48 +02:00
sig { returns(String) }
2020-08-01 02:30:46 +02:00
def self.description
"Dump raw source of a <cask> to the standard output."
2017-05-21 00:15:56 +02:00
end
2020-10-20 12:03:48 +02:00
sig { void }
2017-05-19 21:13:08 +02:00
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
2017-05-21 00:15:56 +02:00
end
2016-09-24 13:52:43 +02:00
end
end
2016-08-18 22:11:42 +03:00
end
end