chshersh / tool-sync

🧰 Download pre-built binaries of all your favourite tools with a single command
https://crates.io/crates/tool-sync
Mozilla Public License 2.0
69 stars 16 forks source link

[#49] Specify which version of the tool was actually downloaded #60

Closed MitchellBerend closed 1 year ago

MitchellBerend commented 1 year ago

This resolves #49

I took a stab at implementing this but Im not sure if my approach is the right way to go. Because the list of tools is already known before actually calling the github api the length of these names is also known. This is not that case with the tag_name. The tags from the example file are all less than 7 long but that does not guarantee other repos.

I could try and check what tags are available for all tools before actually downloading them. Can I get your input on this?

$ cargo run -- --config tools.toml sync
    Finished dev [unoptimized + debuginfo] target(s) in 0.02s
     Running `target/debug/tool --config tools.toml sync`
✅  bat        v0.21.0  Completed!
✅  difftastic 0.34.0   Completed!
✅  exa        v0.10.1  Completed!
✅  fd         v8.4.0   Completed!
✅  ripgrep    13.0.0   Completed!
chshersh commented 1 year ago

@MitchellBerend Wow, thanks a lot for working on this! I'll have a look as soon as I can 🤗

MitchellBerend commented 1 year ago

61 might actually solve the issue that I have with my pr since it does actually give some idea about the length of the tag before the program reaches out to github. We can maybe assume latest as the lower bound and the longest tag as the upper bound like you did with max_tool_size