-
-
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -266,3 +266,5 @@ def self.app_management_permissions_granted?(app:, command:) | |
end | ||
end | ||
end | ||
|
||
require "extend/os/cask/quarantine" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# typed: strict | ||
# frozen_string_literal: true | ||
|
||
require "extend/os/mac/cask/artifact/moved" if OS.mac? | ||
require "extend/os/linux/cask/artifact/moved" if OS.linux? | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# typed: strict | ||
# frozen_string_literal: true | ||
|
||
require "extend/os/linux/cask/config" if OS.linux? |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# typed: strict | ||
# frozen_string_literal: true | ||
|
||
require "extend/os/linux/cask/quarantine" if OS.linux? |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# typed: strict | ||
# frozen_string_literal: true | ||
|
||
module OS | ||
module Linux | ||
module Cask | ||
module Artifact | ||
module Moved | ||
extend T::Helpers | ||
|
||
requires_ancestor { ::Cask::Artifact::Moved } | ||
|
||
sig { params(target: Pathname).returns(T::Boolean) } | ||
def undeletable?(target) | ||
!target.parent.writable? | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
|
||
Cask::Artifact::Moved.prepend(OS::Linux::Cask::Config) |
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,34 @@ | ||||||||||||||
# typed: strict | ||||||||||||||
# frozen_string_literal: true | ||||||||||||||
|
||||||||||||||
require "os/linux" | ||||||||||||||
|
||||||||||||||
module OS | ||||||||||||||
module Linux | ||||||||||||||
module Cask | ||||||||||||||
module Config | ||||||||||||||
extend T::Helpers | ||||||||||||||
|
||||||||||||||
requires_ancestor { ::Cask::Config } | ||||||||||||||
|
||||||||||||||
Comment on lines
+10
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This shouldn't be necessary:
Suggested change
|
||||||||||||||
module ClassMethods | ||||||||||||||
DEFAULT_DIRS = T.let({ | ||||||||||||||
vst_plugindir: "~/.vst", | ||||||||||||||
vst3_plugindir: "~/.vst3", | ||||||||||||||
fontdir: "#{ENV.fetch("XDG_DATA_HOME", "~/.local/share")}/fonts", | ||||||||||||||
}.freeze, T::Hash[Symbol, T.nilable(String)]) | ||||||||||||||
|
||||||||||||||
sig { returns(T::Hash[Symbol, T.untyped]) } | ||||||||||||||
Comment on lines
+19
to
+21
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should be able to tighten up the types:
Suggested change
|
||||||||||||||
def self.defaults | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Needs to be an instance method for
Suggested change
(It will become a class method once prepended to the singleton class 🤷 🤕 ) |
||||||||||||||
{ | ||||||||||||||
languages: LazyObject.new { Linux.languages }, | ||||||||||||||
}.merge(DEFAULT_DIRS).freeze | ||||||||||||||
end | ||||||||||||||
end | ||||||||||||||
end | ||||||||||||||
end | ||||||||||||||
end | ||||||||||||||
end | ||||||||||||||
|
||||||||||||||
Cask::Config.singleton_class.prepend(OS::Linux::Cask::Config::ClassMethods) | ||||||||||||||
Cask::Config.prepend(OS::Linux::Cask::Config) | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this is necessary
Suggested change
|
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,24 @@ | ||||||||||
# typed: strict | ||||||||||
# frozen_string_literal: true | ||||||||||
|
||||||||||
module OS | ||||||||||
module Linux | ||||||||||
module Cask | ||||||||||
module Quarantine | ||||||||||
extend T::Helpers | ||||||||||
|
||||||||||
requires_ancestor { ::Cask::Quarantine } | ||||||||||
|
||||||||||
sig { returns(Symbol) } | ||||||||||
def self.check_quarantine_support | ||||||||||
:linux | ||||||||||
end | ||||||||||
Comment on lines
+13
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
|
||||||||||
sig { returns(T::Boolean) } | ||||||||||
def self.available? = false | ||||||||||
end | ||||||||||
end | ||||||||||
end | ||||||||||
end | ||||||||||
|
||||||||||
Cask::Quarantine.prepend(OS::Linux::Cask::Quarantine) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# typed: strict | ||
# frozen_string_literal: true | ||
|
||
require "cask/macos" | ||
|
||
module OS | ||
module Mac | ||
module Cask | ||
module Artifact | ||
module Moved | ||
extend T::Helpers | ||
|
||
requires_ancestor { ::Cask::Artifact::Moved } | ||
|
||
sig { params(target: Pathname).returns(T::Boolean) } | ||
def undeletable?(target) | ||
MacOS.undeletable?(target) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
|
||
Cask::Artifact::Moved.prepend(OS::Mac::Cask::Artifact::Moved) |
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.
Not something to take on in this PR, but I wonder if we should have a single require file for all of an OS's extensions, rather than introduce three more require files here. 🤔