Rename Volumes.which to avoid incompatible override
This commit is contained in:
parent
ceb2291be1
commit
2dc4c7a4d2
@ -10,11 +10,8 @@ module OS
|
|||||||
@volumes = T.let(get_mounts, T::Array[String])
|
@volumes = T.let(get_mounts, T::Array[String])
|
||||||
end
|
end
|
||||||
|
|
||||||
# This is a pre-existing violation that should be refactored
|
sig { params(path: T.nilable(Pathname)).returns(Integer) }
|
||||||
# rubocop:todo Sorbet/AllowIncompatibleOverride
|
def index_of(path)
|
||||||
sig { override(allow_incompatible: true).params(path: T.nilable(Pathname)).returns(Integer) }
|
|
||||||
# rubocop:enable Sorbet/AllowIncompatibleOverride
|
|
||||||
def which(path)
|
|
||||||
vols = get_mounts path
|
vols = get_mounts path
|
||||||
|
|
||||||
# no volume found
|
# no volume found
|
||||||
@ -429,13 +426,13 @@ module OS
|
|||||||
|
|
||||||
# Find the volumes for the TMP folder & HOMEBREW_CELLAR
|
# Find the volumes for the TMP folder & HOMEBREW_CELLAR
|
||||||
real_cellar = HOMEBREW_CELLAR.realpath
|
real_cellar = HOMEBREW_CELLAR.realpath
|
||||||
where_cellar = volumes.which real_cellar
|
where_cellar = volumes.index_of real_cellar
|
||||||
|
|
||||||
begin
|
begin
|
||||||
tmp = Pathname.new(Dir.mktmpdir("doctor", HOMEBREW_TEMP))
|
tmp = Pathname.new(Dir.mktmpdir("doctor", HOMEBREW_TEMP))
|
||||||
begin
|
begin
|
||||||
real_tmp = tmp.realpath.parent
|
real_tmp = tmp.realpath.parent
|
||||||
where_tmp = volumes.which real_tmp
|
where_tmp = volumes.index_of real_tmp
|
||||||
ensure
|
ensure
|
||||||
Dir.delete tmp.to_s
|
Dir.delete tmp.to_s
|
||||||
end
|
end
|
||||||
|
@ -40,7 +40,11 @@ module Homebrew
|
|||||||
yield if block_given?
|
yield if block_given?
|
||||||
args.map!(&:to_s)
|
args.map!(&:to_s)
|
||||||
begin
|
begin
|
||||||
|
if argv0
|
||||||
exec(cmd, argv0, *args, **options)
|
exec(cmd, argv0, *args, **options)
|
||||||
|
else
|
||||||
|
exec(cmd, *args, **options)
|
||||||
|
end
|
||||||
rescue
|
rescue
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user