winpax/sfsu

sfsu crashes when there are files in the scoop buckets folder

Closed this issue · 3 comments

Describe the bug
scoop search panics when there are files in scoop/buckets/ which are not in a sub-folder

To Reproduce
Steps to reproduce the behavior:

  1. install scoop and set up sfsu
  2. update scoop buckets
  3. create a file in %USERPROFILE%/scoop/buckets/
  4. run sfsu search test

Expected behavior
sfsu skips over files not in subfolders or provides a clearer error message

Full Output

thread '<unnamed>thread '' panicked at '<unnamed>called `Result::unwrap()` on an `Err` value: Os { code: 267, kind: NotADirectory, message: "The directory name is invalid." }' panicked at '', called `Result::unwrap()` on an `Err` value: Os { code: 267, kind: NotADirectory, message: "The directory name is invalid." }src\commands\search.rs', :src\commands\search.rs133::13322:

Version [e.g. 1.4.0]
sfsu 1.4.13

Why would you want to have loose files in the buckets directory?

It isn't part of the official scoop spec, so I never added support for it.

I created them by accident and it took me a bit to figure out what was happening because the error message are a bit generic, no file path or anything

I'll add a nicer error message when I get the chance.

Thanks for the issue