shilangyu / scoop-search

Fast `scoop search` drop-in replacement 🚀
MIT License
277 stars 10 forks source link

run error #21

Closed ChrisCatCP closed 2 years ago

ChrisCatCP commented 2 years ago
panic: runtime error: index out of range [1] with length 1

goroutine 13 [running]:
main.matchingManifests(0xc00000ad50, 0x2a, 0xc000010088, 0x5, 0x0, 0x0, 0x0)
        /home/runner/work/scoop-search/scoop-search/main.go:133 +0x106b
main.main.func1(0xc00000e3e0, 0x1d, 0xc000010088, 0x5, 0x0, 0xc00003e280, 0xc0000101b0, 0xf62f00, 0xc000108310)
        /home/runner/work/scoop-search/scoop-search/main.go:70 +0x185
created by main.main
        /home/runner/work/scoop-search/scoop-search/main.go:63 +0x253

bucket.zip Both of these files will result in an error

shilangyu commented 2 years ago

Has the issue been resolved? I have not looked at it yet

ChrisCatCP commented 2 years ago

It has not been resolved yet

shilangyu commented 2 years ago

Thank you for attaching erroneous files, this helped a lot. The problem lies in their format, it is incorrect. Refer to this comment: https://github.com/shilangyu/scoop-search/issues/12#issuecomment-765215187

bin field cannot have 1 element arrays. When an array is used it is supposed to declare aliases.

ChrisCatCP commented 2 years ago

I read the scoop document and make a program like this, I think these app manifest files are correct,I found this rule in the document

shilangyu commented 2 years ago

https://github.com/ScoopInstaller/Scoop/wiki/App-Manifests#optional-properties

According to the docs, bin can either be a string or array of strings. If its an array of arrays, then an alias has to be declared.

Anyways, I have decided to support this, will release a new version soon.