Skip to content

Commit

Permalink
fix: fix homebrew cask
Browse files Browse the repository at this point in the history
- resolve #1514
  • Loading branch information
JellyBrick authored Dec 18, 2023
1 parent cc940e2 commit 27a2955
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions youtube-music.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
require 'json'
require 'open-uri'
require 'net/http'

cask "youtube-music" do
desc "YouTube Music Desktop App"
homepage "https://github.com/th-ch/youtube-music"

# Fetch the latest release version from GitHub API
latest_release = JSON.parse(URI.open("https://api.github.com/repos/th-ch/youtube-music/releases/latest").read)['tag_name']
uri = URI("https://api.github.com/repos/th-ch/youtube-music/releases/latest")
response = Net::HTTP.get(uri)
latest_release = JSON.parse(response)['tag_name']
version latest_release

base_url = "https://github.com/th-ch/youtube-music/releases/download/#{latest_release}/YouTube-Music-#{latest_release.delete_prefix('v')}"
Expand All @@ -24,5 +26,4 @@
end

auto_updates true

end

0 comments on commit 27a2955

Please sign in to comment.