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

casks-without-zap: Make Markdown table #144836

Merged
merged 1 commit into from
Apr 10, 2023
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
3 changes: 2 additions & 1 deletion developer/bin/casks-without-zap
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,15 @@ end.freeze
CASK_LISTS = CASKS_NO_ZAP.each_with_object([]) do |(tap_dir, casks), message|
message.push("<details><summary>#{tap_dir.dirname.basename.to_path}</summary>")
message.push("") # Empty line so the markdown still works inside the HTML
message.push("| Cask | Downloads |", "| :--- | ---: |") # Table header

# Sort casks by count
sorted_casks = casks.sort_by { |cask_file| -find_count(cask_name(cask_file), CASK_DATA).delete(",").to_i }

sorted_casks.each do |cask_file|
cask_name = cask_name(cask_file)
count = find_count(cask_name, CASK_DATA)
message.push("* [`#{cask_name}`](#{cask_url(tap_dir, cask_file)}) - Downloads: #{count}")
message.push("| [#{cask_name}](#{cask_url(tap_dir, cask_file)}) | #{count} |")
end

message.push("</details>")
Expand Down