Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autoupdate to manifest url #5977

Open
insertokername opened this issue May 18, 2024 · 4 comments · Fixed by #5988
Open

Autoupdate to manifest url #5977

insertokername opened this issue May 18, 2024 · 4 comments · Fixed by #5988

Comments

@insertokername
Copy link

Hello everyone!

I was wondering if there was any way i could use the autoupdate name@version feature with a manifest specified as a path and not from a bucket.

For example lets say i have a manifest.json that has an autoupdate field. If I were to run:

scoop install ./manifest.json@20

I would receive the error: Couldn't find manifest for 'manifestjson@20'

Is there any workaround to this? Any flags i could set?

@niheaven
Copy link
Member

Unfortunately, this feature is not available in Scoop now. You need to create a manifest containing the correct version.

@niheaven niheaven closed this as not planned Won't fix, can't repro, duplicate, stale May 20, 2024
@insertokername
Copy link
Author

insertokername commented May 21, 2024

Could i start development on this myself?

I would like to add an option flag "-v" or something similar in which i can specify the autoupdate version, the -v flag overwriting the @ symbol.

For me adding buckets takes more time than installing the actual app and is really bothersome especially since i have to do this on multiple machines and wastes a bunch of time. Using a -v flag would be optimal for me in my situation and I'm sure i can find more uses for it. Adding the @ autoupdate selector to links would greatly lessen the time it takes for me to setup my machines.

Hope you consider allowing me to develop this feature!

@insertokername
Copy link
Author

Sorry for the many messages but i have been looking around in the source and i think i have found an easier way of just implementing the original feature i was looking for.

Scoop/lib/core.ps1

Lines 1174 to 1180 in d337bb1

function parse_app([string]$app) {
if ($app -match '^(?:(?<bucket>[a-zA-Z0-9-_.]+)/)?(?<app>.*\.json$|[a-zA-Z0-9-_.]+)(?:@(?<version>.*))?$') {
return $Matches['app'], $Matches['bucket'], $Matches['version']
} else {
return $app, $null, $null
}
}

Changing this regex to

^(?:(?<bucket>[a-zA-Z0-9-_.]+)/)?(?<app>.*\.json|[a-zA-Z0-9-_.]+)(?:@(?<version>.*))?$'

(removing the $ after .json) seems to accomplish exactly what i was looking for in the original request. Examining the regex more i can't seem to find any conflicts that may be caused by removing the $ anchor.

Looking forward to your feedback!

@niheaven
Copy link
Member

You are right, please submit a PR and I'll review it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants