Regexes should be made case insensitive, whenever possible, by adding i at the end (e.g. The livecheck block regex restricts matches to a subset of the fetched content and uses a capture group around the version text. In this scenario, it’s more reliable to use the Git strategy, which fetches all the tags in the repository. For example, we generally avoid checking the release page for a GitHub project because the latest stable version can be pushed off the first page by pre-release versions. The exception to this rule is a livecheck block that only uses skip.Ĭheck for versions in the same location as the stable archive, whenever possible.Īvoid checking paginated release pages, when possible. GithubReleases should only be used if the upstream repository uses releases and both the Git and GithubLatest strategies aren’t suitable.Ī url is required in a livecheck block. GithubLatest should only be used if the upstream repository has a “latest” release for a suitable version and either the formula/cask uses a release asset or the Git strategy can’t correctly identify the latest release version. GitHub rate-limits API requests, so we only use these strategies when Git isn’t sufficient or appropriate. Only use the GithubLatest and GithubReleases strategies when they are necessary and correct. However, if Git applies to a URL but we need to use PageMatch, it’s necessary to specify strategy :page_match. For example, if livecheck is already using the Git strategy for a URL, it’s not necessary to use strategy :git. More information on creating regexes can be found in the regex guidelines section. If the check works without a regex and wouldn’t benefit from having one, it’s usually fine to omit it. When necessary, search for other sources outside of the formula/cask.Ĭreate a regex, if necessary. If it’s not possible to find the newest version on the website, try checking other sources from the formula/cask. If that doesn’t work, try to find a page that links to the file (e.g. Try removing the file name from stable/ url to see if it provides a directory listing page. Research available sources to select a URL. brew livecheck -debug | provides information about which URLs livecheck tries, any strategies that apply, matched versions, etc. Use the debug output to understand the situation. For more information on the available methods, please refer to the Livecheck class documentation. This can be accomplished by adding a livecheck block to the formula/cask/resource. If livecheck doesn’t correctly match version text, we need to provide an appropriate regex or strategy block. If a source doesn’t provide the newest version, we need to check a different one. It’s sometimes necessary to override this default behavior to create a working check. Return the newest version (or an error if versions could not be found at any available URLs).If a strategy can be applied, use it to check for new versions.Determine if any strategies apply to the first URL.For casks: Collect the url and homepage URLs, in that order.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |