我正在嘗試為Tentacle Sync Studio提交一個桶,但我在 livecheck 無法找到最新版本時遇到了問題。我運行brew audit --new-cask tentacle-sync-studio并收到以下錯誤- Version '1.30' differs from '' retrieved by livecheck.
cask "tentacle-sync-studio" do
version "1.30"
sha256 "4f7bdaef85b78f576babac91d57da3b3276cc98a2f81ac621bea96a48fe8796a"
url "https://tentaclesync.com/files/downloads/ttsyncstudio-v#{version.dots_to_underscores}.dmg"
name "Tentacle Sync Studio"
desc "Automatically synchronize video and audio via timecode"
homepage "https://tentaclesync.com/"
livecheck do
url "https://tentaclesync.zendesk.com/hc/en-us/articles/115003866805-Tentacle-Sync-Studio-macOS-"
strategy :page_match
regex(%r{/v?(\d (?:\.\d ) )/ttsyncstudio\.dmg}i)
end
depends_on macos: ">= :high_sierra"
app "Tentacle Sync Studio.app"
end
我可能沒有使用正確的“策略”,盡管閱讀了 Homebrew 的說明,但老實說我不知道??如何設定正則運算式。任何幫助表示贊賞。
uj5u.com熱心網友回復:
在vitalsource-bookshelf木桶也有類似的問題:
以前的 livecheck URL 有 Cloudflare 保護,請改用 API URL。
你會想要改變
https://tentaclesync.zendesk.com/hc/en-us/articles/115003866805-Tentacle-Sync-Studio-macOS-
到
https://tentaclesync.zendesk.com/api/v2/help_center/en-us/articles/115003866805
但是,必須進行更多更改才能使實時檢查正常作業:
將正則運算式更改為
href=.*?/ttsyncstudio-v?(\d (?:[._-]\d ) )\.dmg- 我們要匹配這個字串:
href=\"https://tentaclesync.com/files/downloads/ttsyncstudio-v1_30.dmg href=.*?是一個約定homebrew/cask[._-]匹配點、下劃線或連字符(另一種約定)
- 我們要匹配這個字串:
添加
do到strategy :page_match改變下劃線點:strategy :page_match do |page, regex| page.scan(regex).map { |match| match[0].tr("_", ".") } endmatch[0]對應于正則運算式捕獲(\d (?:[._-]\d ) )
最后,您的木桶檔案應如下所示。
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/368156.html
