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