Skip to content
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

fix: replace first directory with wildcard #57

Merged
merged 2 commits into from
Jul 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions cmd/generate-linux-fonts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,15 @@ def get_font_paths(cask)
next unless artifact.key?("font")

artifact["font"].each do |font|
paths << "#{path_prefix}./**/#{font}"
font = font.gsub(/\[|\]/) { |_s| "?" }
font_dir = File.dirname(font)
if font_dir == "."
paths << "#{path_prefix}./**/#{font}"
else
first_dir = font_dir.split("/")[0]
odebug first_dir, font, font.gsub("#{first_dir}/", "**/")
paths << "#{path_prefix}./#{font.gsub("#{first_dir}/", "**/")}"
end
end
end

Expand Down Expand Up @@ -183,7 +191,7 @@ class #{classname} < Formula

formula += <<-EOS

deprecate! "#{cask["deprecation_date"]}", because: #{reason}
deprecate! "#{cask["deprecation_date"]}", because: :#{cask["deprecation_reason"]}
EOS
end

Expand All @@ -192,8 +200,8 @@ class #{classname} < Formula
def install
EOS

paths.each do |path|
formula += <<-EOS
paths.sort.each do |path|
formula += <<-EOS
(share/"fonts").install Dir.glob("#{path}")[0]
EOS
end
Expand Down