Resolve Style/InvertibleUnlessCondition violations (#145823)

This commit is contained in:
Douglas Eichelberger
2023-04-25 15:25:52 -07:00
committed by GitHub
parent 819859c72c
commit 3a70652ebb
7 changed files with 12 additions and 12 deletions

View File

@@ -21,8 +21,8 @@ cask "active-trader-pro" do
# `open -b com.fmr.activetrader`. Therefore, we must suppress this behavior
# to make the cask installation non-interactive.
retries ||= 3
ohai "The Active Trader Pro package postinstall script launches the app" unless retries < 3
ohai "Attempting to close Active Trader Pro to avoid unwanted user intervention" unless retries < 3
ohai "The Active Trader Pro package postinstall script launches the app" if retries >= 3
ohai "Attempting to close Active Trader Pro to avoid unwanted user intervention" if retries >= 3
return unless system_command "/usr/bin/pkill", args: ["-f", "/Applications/Active Trader Pro.app"]
end

View File

@@ -22,8 +22,8 @@ cask "blurscreen" do
# This is because `open "$APP_PATH"&` is called from the postinstall
# script of the package and we don't want any user intervention there.
retries ||= 3
ohai "The BlurScreen package postinstall script launches the BlurScreen app" unless retries < 3
ohai "Attempting to close BlurScreen.app to avoid unwanted user intervention" unless retries < 3
ohai "The BlurScreen package postinstall script launches the BlurScreen app" if retries >= 3
ohai "Attempting to close BlurScreen.app to avoid unwanted user intervention" if retries >= 3
return unless system_command "/usr/bin/pkill", args: ["-f", "/Applications/BlurScreen.app"]
rescue RuntimeError

View File

@@ -20,8 +20,8 @@ cask "gamemaker" do
# This is because `open "$APP_PATH"&` is called from the postinstall
# script of the package and we don't want any user intervention there.
retries ||= 3
ohai "The GameMaker package postinstall script launches the GameMaker app" unless retries < 3
ohai "Attempting to close com.yoyogames.gms2 to avoid unwanted user intervention" unless retries < 3
ohai "The GameMaker package postinstall script launches the GameMaker app" if retries >= 3
ohai "Attempting to close com.yoyogames.gms2 to avoid unwanted user intervention" if retries >= 3
return unless system_command "/usr/bin/pkill", args: ["-f", "/Applications/GameMaker.app"]
rescue RuntimeError

View File

@@ -13,7 +13,7 @@ cask "slicer" do
regex(%r{href=.*?/bitstream/(\h+)["' >].+?["']header["'][^>]*?>\s*v?(\d+(?:\.\d+)+)}im)
strategy :page_match do |page, regex|
match = page.scan(regex)
next unless match.length >= 2
next if match.length < 2
"#{match[1][1]},#{match[1][0]}"
end

View File

@@ -16,8 +16,8 @@ cask "virtual-desktop-streamer" do
postflight do
# postinstall launches the app
retries ||= 3
ohai "The Virtual Desktop package postinstall script launches the Streamer app" unless retries < 3
ohai "Attempting to close the Streamer app to avoid unwanted user intervention" unless retries < 3
ohai "The Virtual Desktop package postinstall script launches the Streamer app" if retries >= 3
ohai "Attempting to close the Streamer app to avoid unwanted user intervention" if retries >= 3
return unless system_command "/usr/bin/pkill", args: ["-f", "/Applications/Virtual Desktop Streamer.app"]
rescue RuntimeError

View File

@@ -25,8 +25,8 @@ cask "zoom" do
# This is because `open "$APP_PATH"&` is called from the postinstall
# script of the package and we don't want any user intervention there.
retries ||= 3
ohai "The Zoom package postinstall script launches the Zoom app" unless retries < 3
ohai "Attempting to close zoom.us.app to avoid unwanted user intervention" unless retries < 3
ohai "The Zoom package postinstall script launches the Zoom app" if retries >= 3
ohai "Attempting to close zoom.us.app to avoid unwanted user intervention" if retries >= 3
return unless system_command "/usr/bin/pkill", args: ["-f", "/Applications/zoom.us.app"]
rescue RuntimeError

View File

@@ -406,7 +406,7 @@ if /^-+debug?$/i.match?(ARGV.first)
ARGV.shift
end
unless ARGV.length == 1
if ARGV.length != 1
puts usage
exit 1
end