Scoop icon indicating copy to clipboard operation
Scoop copied to clipboard

feat: Update schema to support variable autoupdate urls

Open scowalt opened this issue 2 years ago • 2 comments

Description

Before, any autoupdate url had to take the form of a well-formed URI. However, this would throw an error for otherwise-functional urls using variables from checkver that didn't match this schema. Example: (note how $matchUrl will be a valid URL when evaluated, but as a literal string it is not a valid URL)

    "checkver": {
        "url": "https://www.cyberpowersystems.com/product/software/power-panel-personal/powerpanel-personal-windows/",
        "regex": "\"(?<url>https://[^\"]*v(?<version>[^\"]*)\\.exe)\""
    },
    "autoupdate": {
        "architecture": {
            "64bit": {
                "url": "$matchUrl"
            }
        }
    }

Motivation and Context

Closes #5296 Closes #5158 (probably a dupe, but not 100% sure)

How Has This Been Tested?

I have a .json file that shows a warning in VSCode when pointing to the old schema. I pointed my VSCode to the new schema by modifying .vscode/settings.json . The error on my url went away. No new warnings showed up on my other existing packages.

Checklist:

  • [x] I have read the Contributing Guide.
  • [x] I have ensured that I am targeting the develop branch.
  • [x] I have updated the documentation accordingly.
  • [x] I have updated the tests accordingly.
  • [x] I have added an entry in the CHANGELOG.

scowalt avatar Dec 17 '22 23:12 scowalt

All of the tests still pass, and the documentation I could find seems fine as-is

scowalt avatar Dec 17 '22 23:12 scowalt

@scowalt Feel free to add #5158 to Closes as well 👍

brian6932 avatar Dec 18 '22 06:12 brian6932