cask "yuque" do version "3.4.5.1213,BJ9fec021fee4c44d3b96fa62a5a82bc5d" sha256 "b664667b5d8a800fe22fdc4629efea556eea1131bc2d1023c0c452fb219da2c7" url "https://app.nlark.com/yuque-desktop/#{version.csv.first}/#{version.csv.second}/Yuque-#{version.csv.first}.dmg", verified: "app.nlark.com/yuque-desktop/" name "Yuque" name "语雀" desc "Cloud knowledge base" homepage "https://www.yuque.com/" # The version on the download page is the stable version (see: # https://github.com/Homebrew/homebrew-cask/pull/111472) livecheck do url "https://www.yuque.com/download/" regex(/yuque-desktop%2Fv?(\d+(?:\.\d+)+)%2F([a-z0-9]+).*?\.dmg/i) strategy :page_match do |page, regex| page.scan(regex).map { |match| "#{match[0]},#{match[1]}" } end end app "语雀.app" zap trash: [ "~/Library/Application Support/yuque-desktop", "~/Library/Preferences/com.yuque.app.plist", "~/Library/Saved Application State/com.yuque.app.savedState", ] end