mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
brew style --fix
This commit is contained in:
parent
992025dc1a
commit
63d8de3600
@ -56,7 +56,7 @@ module Cask
|
|||||||
message = "It seems there is already #{self.class.english_article} " \
|
message = "It seems there is already #{self.class.english_article} " \
|
||||||
"#{self.class.english_name} at '#{target}'"
|
"#{self.class.english_name} at '#{target}'"
|
||||||
|
|
||||||
if force && target.symlink? && \
|
if force && target.symlink? &&
|
||||||
(target.realpath == source.realpath || target.realpath.to_s.start_with?("#{cask.caskroom_path}/"))
|
(target.realpath == source.realpath || target.realpath.to_s.start_with?("#{cask.caskroom_path}/"))
|
||||||
opoo "#{message}; overwriting."
|
opoo "#{message}; overwriting."
|
||||||
target.delete
|
target.delete
|
||||||
|
@ -72,7 +72,7 @@ module Homebrew
|
|||||||
|
|
||||||
ambiguous_casks = []
|
ambiguous_casks = []
|
||||||
if !args.formula? && !args.cask?
|
if !args.formula? && !args.cask?
|
||||||
ambiguous_casks = formulae_and_casks \
|
ambiguous_casks = formulae_and_casks
|
||||||
.group_by { |item| Livecheck.package_or_resource_name(item, full_name: true) }
|
.group_by { |item| Livecheck.package_or_resource_name(item, full_name: true) }
|
||||||
.values
|
.values
|
||||||
.select { |items| items.length > 1 }
|
.select { |items| items.length > 1 }
|
||||||
|
@ -182,7 +182,7 @@ module Homebrew
|
|||||||
|
|
||||||
ambiguous_casks = []
|
ambiguous_casks = []
|
||||||
if handle_name_conflict
|
if handle_name_conflict
|
||||||
ambiguous_casks = formulae_and_casks_to_check \
|
ambiguous_casks = formulae_and_casks_to_check
|
||||||
.group_by { |item| package_or_resource_name(item, full_name: true) }
|
.group_by { |item| package_or_resource_name(item, full_name: true) }
|
||||||
.values
|
.values
|
||||||
.select { |items| items.length > 1 }
|
.select { |items| items.length > 1 }
|
||||||
|
@ -360,15 +360,15 @@ class Migrator
|
|||||||
|
|
||||||
# Remove `opt/oldname` link if it belongs to newname.
|
# Remove `opt/oldname` link if it belongs to newname.
|
||||||
def unlink_oldname_opt
|
def unlink_oldname_opt
|
||||||
return unless old_opt_record
|
return if old_opt_record.blank?
|
||||||
|
return unless old_opt_record.symlink?
|
||||||
|
return unless old_opt_record.exist?
|
||||||
|
return unless new_linked_keg_record.exist?
|
||||||
|
return if new_linked_keg_record.realpath != old_opt_record.realpath
|
||||||
|
|
||||||
if old_opt_record.symlink? && old_opt_record.exist? \
|
|
||||||
&& new_linked_keg_record.exist? \
|
|
||||||
&& new_linked_keg_record.realpath == old_opt_record.realpath
|
|
||||||
old_opt_record.unlink
|
old_opt_record.unlink
|
||||||
old_opt_record.parent.rmdir_if_possible
|
old_opt_record.parent.rmdir_if_possible
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
# Remove `Cellar/oldname` if it exists.
|
# Remove `Cellar/oldname` if it exists.
|
||||||
def link_oldname_cellar
|
def link_oldname_cellar
|
||||||
|
@ -120,7 +120,7 @@ class SoftwareSpec
|
|||||||
end
|
end
|
||||||
|
|
||||||
def bottled?(tag = nil)
|
def bottled?(tag = nil)
|
||||||
bottle_tag?(tag) && \
|
bottle_tag?(tag) &&
|
||||||
(tag.present? || bottle_specification.compatible_locations? || owner.force_bottle)
|
(tag.present? || bottle_specification.compatible_locations? || owner.force_bottle)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -236,7 +236,7 @@ describe SystemCommand do
|
|||||||
"-c",
|
"-c",
|
||||||
'printf "\r%s" "################### 27.6%" 1>&2',
|
'printf "\r%s" "################### 27.6%" 1>&2',
|
||||||
]
|
]
|
||||||
end.to output( \
|
end.to output(
|
||||||
"\r################### 27.6%",
|
"\r################### 27.6%",
|
||||||
).to_stderr
|
).to_stderr
|
||||||
end
|
end
|
||||||
|
@ -155,7 +155,7 @@ describe PyPI do
|
|||||||
|
|
||||||
describe "<=>" do
|
describe "<=>" do
|
||||||
it "returns -1" do
|
it "returns -1" do
|
||||||
expect(package <=> other_package).to eq((-1))
|
expect(package <=> other_package).to eq(-1)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "returns 0" do
|
it "returns 0" do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user