Skip to content

Commit

Permalink
casks-without-zap: Make Markdown table (#144836)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitorgalvao committed Apr 10, 2023
1 parent a32383f commit 08ad6ef
Showing 1 changed file with 2 additions and 1 deletion.
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

0 comments on commit 08ad6ef

Please sign in to comment.