Closed MitchellBerend closed 1 year ago
Maybe its better to target a specific region in the asset name? Something like after the last instance of .
so for example shadow.tar.gz
still gets recognized as a hit.
I propose to add a filter to settings and use a wildcard for filtering
Do you have suggestions on what this would look like?
Do you have suggestions on what this would look like?
[starship]
owner = "starship"
repo = "starship"
exe_name = "starship"
asset_name.windows = "starship-x86_64-pc-windows-msvc.zip"
asset_name.exclude = ["*.tar.gz", "*.sha256"]
Can you try and implement this @slyshykO? I don't see a nice way to filter on multiple things without using regex in a loop.
The current filter lives on line 81 of this file: https://github.com/chshersh/tool-sync/blob/dd7a006da995285eb925965472d67f87107d8c19/src/model/tool.rs#L75-L97
@MitchellBerend can I add a new dependency https://crates.io/crates/wildmatch?
Hey, @MitchellBerend @slyshykO, could I ask you not to rush the implementation of this? I would like everyone to agree on the final design before we spent a lot of time implementing code that will be thrown away 🙏🏻
I'll try to provide my thoughts in #50 and I'll mention everyone to request feedback 🙂
As for wildmatch
: do you mean to use it to implement a separate asset_name.exclude
field? I'm not sure I want to go that way. And wildmatch
doesn't support $
so we can solve this problem without a separate field.
I'd rather spend some time thinking about the proper filtering (inclusion/exclusion) mechanism 🤔
As for wildmatch: do you mean to use it to implement a separate asset_name.exclude field? I'm not sure I want to go that way.
As an alternative, there is possible to consider an asset's names as wildcards.
As an example: *x86_64-pc-windows-msvc.zip
.
I'm closing this pr so others won't see a pr linked to the original issue.
Resolves #116 This pr adds filters out the
sha
substring in the asset name so it does not get trigger aMultipleFound
error. It also augments a test to check this behaviour.Thanks to @slyshykO for finding this bug and reporting it.
Additional tasks