Scoop icon indicating copy to clipboard operation
Scoop copied to clipboard

Autoupdate to manifest url

Open insertokname opened this issue 1 year ago • 4 comments

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?

insertokname avatar May 18 '24 11:05 insertokname

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

niheaven avatar May 20 '24 06:05 niheaven

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!

insertokname avatar May 21 '24 20:05 insertokname

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.

https://github.com/ScoopInstaller/Scoop/blob/d337bb1fa69a56637101254a1ac9e0ad13a12647/lib/core.ps1#L1174-L1180

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!

insertokname avatar May 21 '24 22:05 insertokname

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

niheaven avatar May 22 '24 02:05 niheaven