-
-
Notifications
You must be signed in to change notification settings - Fork 9.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: allow font install on linux #18874
base: master
Are you sure you want to change the base?
Conversation
801829e
to
e5c2c8c
Compare
e5c2c8c
to
d1b5f68
Compare
Installing fonts now works, although it is still installing in the macOS location. I can't get the DEFAULTS to work. |
99e0454
to
ed30ba7
Compare
ed30ba7
to
378ff7c
Compare
}.freeze, T::Hash[Symbol, T.nilable(String)]) | ||
|
||
sig { returns(T::Hash[Symbol, T.untyped]) } | ||
def self.defaults |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Homebrew/brew I can't get the code to pick up this extended version, no matter what I try. Does anyone have a suggestion how to do that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dduugg may know!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugh, guilty 😬
prepend
ing (like include
) only affects instance methods. If I understand what you're trying to do here, you'll want to write this as an instance method in a submodule (e.g. ClassMethods
) which is then prepended to the singleton class. See Keg
for an example of this dual-prepend
approach, specifically:
brew/Library/Homebrew/extend/os/mac/keg.rb
Lines 130 to 131 in e23d079
Keg.singleton_class.prepend(OS::Mac::Keg::ClassMethods) | |
Keg.prepend(OS::Mac::Keg) |
(I'm entirely to blame for this convoluted mess, and I'm open to alternatives. It's probably useful to document this for others, maybe in Typechecking.md
, though it has discoverability issues.)
def self.available? | ||
false | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a stylistic choice until I get around to writing a linter rule, but I like these as endless def
s, since they are pseudo-constants. (It also saves some vertical real estate.):
def self.available? | |
false | |
end | |
def self.available? = false |
raise ::Cask::CaskError, "macOS is required for this software." unless artifacts.reject do |k| | ||
k.is_a?(::Cask::Artifact::Font) | ||
end.empty? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this equivalent logic? (The triple negative of unless
/reject
/empty?
hurts my tiny 🧠)
raise ::Cask::CaskError, "macOS is required for this software." unless artifacts.reject do |k| | |
k.is_a?(::Cask::Artifact::Font) | |
end.empty? | |
raise ::Cask::CaskError, "macOS is required for this software." if artifacts.any? do |k| | |
k.is_a?(::Cask::Artifact::Font) | |
end |
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?This should disable quarantine on Linux, allow installing fonts and set a location for the fonts. Marking this as draft until I've had a moment to test it.
Waiting for #18808 to be merged