os/mac/xcode: remove unnecessary type assertion
This commit is contained in:
parent
4b7eec6104
commit
cf08039712
@ -95,21 +95,17 @@ module OS
|
|||||||
# directory or nil if Xcode.app is not installed.
|
# directory or nil if Xcode.app is not installed.
|
||||||
sig { returns(T.nilable(Pathname)) }
|
sig { returns(T.nilable(Pathname)) }
|
||||||
def self.prefix
|
def self.prefix
|
||||||
return @prefix if defined?(@prefix)
|
@prefix ||= begin
|
||||||
|
dir = MacOS.active_developer_dir
|
||||||
|
|
||||||
@prefix = T.let(@prefix, T.nilable(Pathname))
|
if dir.empty? || dir == CLT::PKG_PATH || !File.directory?(dir)
|
||||||
@prefix ||=
|
path = bundle_path
|
||||||
begin
|
path/"Contents/Developer" if path
|
||||||
dir = MacOS.active_developer_dir
|
else
|
||||||
|
# Use cleanpath to avoid pathological trailing slash
|
||||||
if dir.empty? || dir == CLT::PKG_PATH || !File.directory?(dir)
|
Pathname.new(dir).cleanpath
|
||||||
path = bundle_path
|
|
||||||
path/"Contents/Developer" if path
|
|
||||||
else
|
|
||||||
# Use cleanpath to avoid pathological trailing slash
|
|
||||||
Pathname.new(dir).cleanpath
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
sig { returns(Pathname) }
|
sig { returns(Pathname) }
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user