feat(checkver): Present script property#3900
Merged
r15ch13 merged 2 commits intoScoopInstaller:developfrom Apr 20, 2020
Merged
Conversation
Related ScoopInstaller#3869 This is usefull when vendors provide complex webpages/requires specific request method / have webpage encoded / or you just want to create simplier structure for matching I want to keep the functionality of matching, so the script should always return the string, which represent the actual page.  Examples: ```json { "version": "8.0.3-1", "homepage": "https://www.swi-prolog.org", "description": "Comprehensive Prolog environment", "license": "MIT", "architecture": { "64bit": { "url": "https://www.swi-prolog.org/download/stable/bin/swipl-8.0.3-1.x64.exe#/dl.7z", "hash": "f3b4783dd05a746219600185e8404238ee451708f3512c601a2c99cf549b0fa5" }, "32bit": { "url": "https://www.swi-prolog.org/download/stable/bin/swipl-8.0.3-1.x86.exe#/dl.7z", "hash": "7b6b7295a8a19d350f16b38b00201725091e5d8272d4694c8df8696eabe45767" } }, "bin": [ "bin\\swipl.exe", "bin\\swipl-ld.exe" ], "shortcuts": [ [ "bin\\swipl-win.exe", "SWI-Prolog" ] ], "checkver": { "script": "return (iwr 'https://www.swi-prolog.org/download/stable/bin/').Content", "regex": "swipl-([\\d.-]+)\\.x64\\.exe" }, "autoupdate": { "architecture": { "64bit": { "url": "https://www.swi-prolog.org/download/stable/bin/swipl-$version.x64.exe#/dl.7z" }, "32bit": { "url": "https://www.swi-prolog.org/download/stable/bin/swipl-$version.x86.exe#/dl.7z" } }, "hash": { "url": "$url.sha256" } } } ``` ```json { "description": "Amazon Corretto is a no-cost, multiplatform, production-ready distribution of the Open Java Development Kit (OpenJDK)", "homepage": "https://aws.amazon.com/corretto/", "version": "11.0.6.10.1-1", "license": "GPL-2.0-only WITH Classpath-exception-2.0", "architecture": { "64bit": { "url": "https://corretto.aws/downloads/latest/amazon-corretto-11-x64-windows-jdk.zip", "hash": "md5:9d590d3e1d4fe8b927f0b8498f992d53" } }, "extract_to": "tmp", "installer": { "script": [ "(Get-ChildItem -Directory \"$dir\\tmp\").FullName | % { Move-Item \"$_\\*\" \"$dir\" }", "Remove-Item -Recurse \"$dir\\tmp\"" ] }, "env_add_path": "bin", "env_set": { "JAVA_HOME": "$dir" }, "checkver": { "script": [ "$cosi = curl.exe -v 'https://corretto.aws/downloads/latest/amazon-corretto-11-x64-windows-jdk.zip' *>&1", "return $cosi | select-string '< Location: ' -Raw" ], "regex": "Location:\\s+.*?/[\\d.]+/(?<file>amazon-corretto-([\\d.-]+)-windows)-x64-jdk.zip" }, "autoupdate": { "architecture": { "64bit": { "url": "https://corretto.aws/downloads/latest/amazon-corretto-11-x64-windows-jdk.zip", "hash": { "url": "https://corretto.aws/downloads/latest_checksum/amazon-corretto-11-x64-windows-jdk.zip" } } } } } ```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related #3869
This is usefull when vendors provide complex webpages/requires specific request method / have webpage encoded / or you just want to create simplier structure for matching
I want to keep it simple and support the functionality of matching, so the script should always return the string, which represent the actual page.
Examples:
{ "version": "8.0.3-1", "homepage": "https://www.swi-prolog.org", "description": "Comprehensive Prolog environment", "license": "MIT", "architecture": { "64bit": { "url": "https://www.swi-prolog.org/download/stable/bin/swipl-8.0.3-1.x64.exe#/dl.7z", "hash": "f3b4783dd05a746219600185e8404238ee451708f3512c601a2c99cf549b0fa5" }, "32bit": { "url": "https://www.swi-prolog.org/download/stable/bin/swipl-8.0.3-1.x86.exe#/dl.7z", "hash": "7b6b7295a8a19d350f16b38b00201725091e5d8272d4694c8df8696eabe45767" } }, "bin": [ "bin\\swipl.exe", "bin\\swipl-ld.exe" ], "shortcuts": [ [ "bin\\swipl-win.exe", "SWI-Prolog" ] ], "checkver": { "script": "return (iwr 'https://www.swi-prolog.org/download/stable/bin/').Content", "regex": "swipl-([\\d.-]+)\\.x64\\.exe" }, "autoupdate": { "architecture": { "64bit": { "url": "https://www.swi-prolog.org/download/stable/bin/swipl-$version.x64.exe#/dl.7z" }, "32bit": { "url": "https://www.swi-prolog.org/download/stable/bin/swipl-$version.x86.exe#/dl.7z" } }, "hash": { "url": "$url.sha256" } } }{ "description": "Amazon Corretto is a no-cost, multiplatform, production-ready distribution of the Open Java Development Kit (OpenJDK)", "homepage": "https://aws.amazon.com/corretto/", "version": "11.0.6.10.1-1", "license": "GPL-2.0-only WITH Classpath-exception-2.0", "architecture": { "64bit": { "url": "https://corretto.aws/downloads/latest/amazon-corretto-11-x64-windows-jdk.zip", "hash": "md5:9d590d3e1d4fe8b927f0b8498f992d53" } }, "extract_to": "tmp", "installer": { "script": [ "(Get-ChildItem -Directory \"$dir\\tmp\").FullName | % { Move-Item \"$_\\*\" \"$dir\" }", "Remove-Item -Recurse \"$dir\\tmp\"" ] }, "env_add_path": "bin", "env_set": { "JAVA_HOME": "$dir" }, "checkver": { "script": [ "$cosi = curl.exe -v 'https://corretto.aws/downloads/latest/amazon-corretto-11-x64-windows-jdk.zip' *>&1", "return $cosi | select-string '< Location: ' -Raw" ], "regex": "Location:\\s+.*?/[\\d.]+/(?<file>amazon-corretto-([\\d.-]+)-windows)-x64-jdk.zip" }, "autoupdate": { "architecture": { "64bit": { "url": "https://corretto.aws/downloads/latest/amazon-corretto-11-x64-windows-jdk.zip", "hash": { "url": "https://corretto.aws/downloads/latest_checksum/amazon-corretto-11-x64-windows-jdk.zip" } } } } }