parent
d39ba743f9
commit
6b697470fd
@ -156,11 +156,11 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
if new_hash.present? && cask.language.blank? # avoid repeated replacement for multilanguage cask
|
if new_hash.present? && cask.language.blank? # avoid repeated replacement for multilanguage cask
|
||||||
hash_regex = old_hash == :no_check ? ":no_check" : "[\"']#{Regexp.escape(old_hash.to_s)}[\"']"
|
hash_regex = (old_hash == :no_check) ? ":no_check" : "[\"']#{Regexp.escape(old_hash.to_s)}[\"']"
|
||||||
|
|
||||||
replacement_pairs << [
|
replacement_pairs << [
|
||||||
/sha256\s+#{hash_regex}/m,
|
/sha256\s+#{hash_regex}/m,
|
||||||
"sha256 #{new_hash == :no_check ? ":no_check" : "\"#{new_hash}\""}",
|
"sha256 #{(new_hash == :no_check) ? ":no_check" : "\"#{new_hash}\""}",
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -401,7 +401,7 @@ module RuboCop
|
|||||||
info[:if_module], info[:if_method] = if ON_ARCH_OPTIONS.include?(on_system_option)
|
info[:if_module], info[:if_method] = if ON_ARCH_OPTIONS.include?(on_system_option)
|
||||||
["Hardware::CPU", :"#{on_system_option}?"]
|
["Hardware::CPU", :"#{on_system_option}?"]
|
||||||
elsif ON_BASE_OS_OPTIONS.include?(on_system_option)
|
elsif ON_BASE_OS_OPTIONS.include?(on_system_option)
|
||||||
["OS", on_system_option == :macos ? :mac? : :linux?]
|
["OS", (on_system_option == :macos) ? :mac? : :linux?]
|
||||||
else
|
else
|
||||||
["MacOS", :version]
|
["MacOS", :version]
|
||||||
end
|
end
|
||||||
@ -493,7 +493,7 @@ module RuboCop
|
|||||||
else_info = if else_node.present?
|
else_info = if else_node.present?
|
||||||
{
|
{
|
||||||
can_autocorrect: true,
|
can_autocorrect: true,
|
||||||
on_system_method: on_system_option == :intel ? "on_arm" : "on_intel",
|
on_system_method: (on_system_option == :intel) ? "on_arm" : "on_intel",
|
||||||
node: else_node,
|
node: else_node,
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
@ -505,7 +505,7 @@ module RuboCop
|
|||||||
else_info = if else_node.present?
|
else_info = if else_node.present?
|
||||||
{
|
{
|
||||||
can_autocorrect: true,
|
can_autocorrect: true,
|
||||||
on_system_method: on_system_option == :macos ? "on_linux" : "on_macos",
|
on_system_method: (on_system_option == :macos) ? "on_linux" : "on_macos",
|
||||||
node: else_node,
|
node: else_node,
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
@ -405,7 +405,7 @@ module Homebrew
|
|||||||
cmd = command.join(" ")
|
cmd = command.join(" ")
|
||||||
|
|
||||||
options = []
|
options = []
|
||||||
options << "Type=#{@launch_only_once == true ? "oneshot" : "simple"}"
|
options << "Type=#{(@launch_only_once == true) ? "oneshot" : "simple"}"
|
||||||
options << "ExecStart=#{cmd}"
|
options << "ExecStart=#{cmd}"
|
||||||
|
|
||||||
options << "Restart=always" if @keep_alive.present? && @keep_alive[:always].present?
|
options << "Restart=always" if @keep_alive.present? && @keep_alive[:always].present?
|
||||||
@ -441,8 +441,8 @@ module Homebrew
|
|||||||
options << "OnUnitActiveSec=#{@interval}" if @run_type == RUN_TYPE_INTERVAL
|
options << "OnUnitActiveSec=#{@interval}" if @run_type == RUN_TYPE_INTERVAL
|
||||||
|
|
||||||
if @run_type == RUN_TYPE_CRON
|
if @run_type == RUN_TYPE_CRON
|
||||||
minutes = @cron[:Minute] == "*" ? "*" : format("%02d", @cron[:Minute])
|
minutes = (@cron[:Minute] == "*") ? "*" : format("%02d", @cron[:Minute])
|
||||||
hours = @cron[:Hour] == "*" ? "*" : format("%02d", @cron[:Hour])
|
hours = (@cron[:Hour] == "*") ? "*" : format("%02d", @cron[:Hour])
|
||||||
options << "OnCalendar=#{@cron[:Weekday]}-*-#{@cron[:Month]}-#{@cron[:Day]} #{hours}:#{minutes}:00"
|
options << "OnCalendar=#{@cron[:Weekday]}-*-#{@cron[:Month]}-#{@cron[:Day]} #{hours}:#{minutes}:00"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -582,7 +582,7 @@ class BottleSpecification
|
|||||||
tags = collector.tags.sort_by do |tag|
|
tags = collector.tags.sort_by do |tag|
|
||||||
version = tag.to_macos_version
|
version = tag.to_macos_version
|
||||||
# Give arm64 bottles a higher priority so they are first
|
# Give arm64 bottles a higher priority so they are first
|
||||||
priority = tag.arch == :arm64 ? "2" : "1"
|
priority = (tag.arch == :arm64) ? "2" : "1"
|
||||||
"#{priority}.#{version}_#{tag}"
|
"#{priority}.#{version}_#{tag}"
|
||||||
rescue MacOSVersionError
|
rescue MacOSVersionError
|
||||||
# Sort non-MacOS tags below MacOS tags.
|
# Sort non-MacOS tags below MacOS tags.
|
||||||
|
@ -49,7 +49,7 @@ module Homebrew
|
|||||||
.partition { |f| f.realpath == HOMEBREW_BREW_FILE.realpath || f.extname == ".sh" }
|
.partition { |f| f.realpath == HOMEBREW_BREW_FILE.realpath || f.extname == ".sh" }
|
||||||
|
|
||||||
rubocop_result = if shell_files.any? && ruby_files.none?
|
rubocop_result = if shell_files.any? && ruby_files.none?
|
||||||
output_type == :json ? [] : true
|
(output_type == :json) ? [] : true
|
||||||
else
|
else
|
||||||
run_rubocop(ruby_files, output_type,
|
run_rubocop(ruby_files, output_type,
|
||||||
fix: fix,
|
fix: fix,
|
||||||
@ -60,7 +60,7 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
shellcheck_result = if ruby_files.any? && shell_files.none?
|
shellcheck_result = if ruby_files.any? && shell_files.none?
|
||||||
output_type == :json ? [] : true
|
(output_type == :json) ? [] : true
|
||||||
else
|
else
|
||||||
run_shellcheck(shell_files, output_type, fix: fix)
|
run_shellcheck(shell_files, output_type, fix: fix)
|
||||||
end
|
end
|
||||||
|
@ -252,7 +252,7 @@ class Tap
|
|||||||
if official? && DEPRECATED_OFFICIAL_TAPS.include?(repo)
|
if official? && DEPRECATED_OFFICIAL_TAPS.include?(repo)
|
||||||
odie "#{name} was deprecated. This tap is now empty and all its contents were either deleted or migrated."
|
odie "#{name} was deprecated. This tap is now empty and all its contents were either deleted or migrated."
|
||||||
elsif user == "caskroom" || name == "phinze/cask"
|
elsif user == "caskroom" || name == "phinze/cask"
|
||||||
new_repo = repo == "cask" ? "cask" : "cask-#{repo}"
|
new_repo = (repo == "cask") ? "cask" : "cask-#{repo}"
|
||||||
odie "#{name} was moved. Tap homebrew/#{new_repo} instead."
|
odie "#{name} was moved. Tap homebrew/#{new_repo} instead."
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ cask "with-depends-on-macos-failure" do
|
|||||||
homepage "https://brew.sh/with-depends-on-macos-failure"
|
homepage "https://brew.sh/with-depends-on-macos-failure"
|
||||||
|
|
||||||
# guarantee a mismatched release
|
# guarantee a mismatched release
|
||||||
depends_on macos: MacOS.version == :catalina ? :mojave : :catalina
|
depends_on macos: (MacOS.version == :catalina) ? :mojave : :catalina
|
||||||
|
|
||||||
app "Caffeine.app"
|
app "Caffeine.app"
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user