mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Enable types in remaining untyped extensions
This commit is contained in:
parent
6397229f68
commit
0079cefc95
@ -1,18 +1,16 @@
|
||||
# typed: false
|
||||
# typed: true
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Homebrew
|
||||
extend T::Sig
|
||||
|
||||
module_function
|
||||
|
||||
class << self
|
||||
alias generic_git_tags git_tags
|
||||
end
|
||||
|
||||
def git_tags
|
||||
tags = generic_git_tags
|
||||
tags = Utils.popen_read("git tag --list | sort -rV") if tags.blank?
|
||||
tags
|
||||
def git_tags
|
||||
tags = generic_git_tags
|
||||
tags = Utils.popen_read("git tag --list | sort -rV") if tags.blank?
|
||||
tags
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -1,4 +1,4 @@
|
||||
# typed: false
|
||||
# typed: true
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "tempfile"
|
||||
@ -46,7 +46,7 @@ module Homebrew
|
||||
f.write "#!/bin/sh\n"
|
||||
f.chmod 0700
|
||||
f.close
|
||||
return if system f.path
|
||||
return if system T.must(f.path)
|
||||
|
||||
<<~EOS
|
||||
The directory #{HOMEBREW_TEMP} does not permit executing
|
||||
@ -56,12 +56,12 @@ module Homebrew
|
||||
echo 'export HOMEBREW_TEMP=~/tmp' >> #{shell_profile}
|
||||
EOS
|
||||
ensure
|
||||
f.unlink
|
||||
f&.unlink
|
||||
end
|
||||
|
||||
def check_xdg_data_dirs
|
||||
return if ENV["XDG_DATA_DIRS"].blank?
|
||||
return if ENV["XDG_DATA_DIRS"].split("/").include?(HOMEBREW_PREFIX/"share")
|
||||
xdg_data_dirs = ENV["XDG_DATA_DIRS"]
|
||||
return if xdg_data_dirs.blank? || xdg_data_dirs.split("/").include?(HOMEBREW_PREFIX/"share")
|
||||
|
||||
<<~EOS
|
||||
Homebrew's share was not found in your XDG_DATA_DIRS but you have
|
||||
|
@ -1,4 +1,4 @@
|
||||
# typed: false
|
||||
# typed: true
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Hardware
|
||||
@ -111,6 +111,7 @@ module Hardware
|
||||
end
|
||||
|
||||
%w[aes altivec avx avx2 lm ssse3 sse4_2].each do |flag|
|
||||
T.bind(self, T.class_of(Hardware::CPU))
|
||||
define_method("#{flag}?") { flags.include? flag }
|
||||
end
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# typed: false
|
||||
# typed: true
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Homebrew
|
||||
@ -379,7 +379,7 @@ module Homebrew
|
||||
real_tmp = tmp.realpath.parent
|
||||
where_tmp = volumes.which real_tmp
|
||||
ensure
|
||||
Dir.delete tmp
|
||||
Dir.delete tmp.to_s
|
||||
end
|
||||
rescue
|
||||
return
|
||||
|
Loading…
x
Reference in New Issue
Block a user