mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-10 10:11:46 +00:00
Add Homebrew cask install option for MacOS. (#1357)
This commit is contained in:
@ -38,7 +38,12 @@ this [wiki page](https://wiki.archlinux.org/index.php/Arch_User_Repository#Insta
|
|||||||
|
|
||||||
### MacOS
|
### MacOS
|
||||||
|
|
||||||
If you get an error "is damaged and can’t be opened." when launching the app, run the following in the Terminal:
|
You can install the app using Homebrew:
|
||||||
|
```bash
|
||||||
|
brew install --cask https://raw.githubusercontent.com/th-ch/youtube-music/master/youtube-music.rb
|
||||||
|
```
|
||||||
|
|
||||||
|
If you install the app manually and get an error "is damaged and can’t be opened." when launching the app, run the following in the Terminal:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
xattr -cr /Applications/YouTube\ Music.app
|
xattr -cr /Applications/YouTube\ Music.app
|
||||||
|
|||||||
28
youtube-music.rb
Normal file
28
youtube-music.rb
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
require 'json'
|
||||||
|
require 'open-uri'
|
||||||
|
|
||||||
|
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(open("https://api.github.com/repos/th-ch/youtube-music/releases/latest").read)['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')}"
|
||||||
|
file_extension = Hardware::CPU.arm? ? "-arm64.dmg" : ".dmg"
|
||||||
|
url "#{base_url}#{file_extension}"
|
||||||
|
|
||||||
|
# TODO checksum
|
||||||
|
sha256 :no_check
|
||||||
|
|
||||||
|
app "YouTube Music.app"
|
||||||
|
|
||||||
|
postflight do
|
||||||
|
print("Removing quarantine attribute from YouTube Music.app.\n")
|
||||||
|
system "xattr -cr '/Applications/YouTube Music.app'"
|
||||||
|
end
|
||||||
|
|
||||||
|
auto_updates true
|
||||||
|
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user