-
-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support path 'asset_name/bin/<exe_name>' inside assets #54
Comments
Where are the current paths tested? |
@hgrahamcs Hmm, good question 🤔 There're no tests for checking this function specifically. This issue came up when I tried downloading the GitHub CLI tool using
Line 5 in eeed4bb
tool-sync/tests/full-database.toml Lines 4 to 10 in eeed4bb
Adding |
@hgrahamcs Are you still working on this? |
@chshersh are the tasks in this issue still current or do I need to revise this fully? |
@MitchellBerend The tasks in the issue description and my previous comment are still current 👍🏻 Feel free to take this issue. I'd like to release |
@chshersh What is actually required here? Simply adding this path does not work, it tries to download the $ cargo run -- --config tools.toml sync
Finished dev [unoptimized + debuginfo] target(s) in 0.08s
Running `target/debug/tool --config tools.toml sync`
🔄 All done! 📦 Estimated total download size: 7.71 MiB
⛔ github v2.14.7 [error] Unsupported asset type: gh_2.14.7_linux_amd64.deb ✨ Successfully installed 0 tools!
📁 Installation directory: /home/mitchell/rust/tool-sync/bin $ cat tools.toml
# # tool-sync default configuration file
# https://github.com/chshersh/tool-sync
# This file was automatically generated by tool-sync
#####################################################
#
#
store_directory = "$HOME/rust/tool-sync/bin"
#
# tool-sync provides native support for some of the tools without the need to configure them
# Uncomment the tools you want to have them
#
#[bat]
#[difftastic]
#[fd]
#[ripgrep]
#
# To add configuration for other tools these are the config options:
[github]
owner = "cli"
repo = "cli"
exe_name = "gh"
#
# # Uncomment to download a specific version or tag.
# # Without this tag latest will be used
tag = "v2.14.7"
#
#
# Asset name to download on linux OSes
asset_name.linux = "linux_amd64"
#
# uncomment if you want to install on macOS as well
# asset_name.macos = "apple-darwin"
#
# uncomment if you want to install on Windows as well
# asset_name.windows = "x86_64-pc-windows-msvc" $ git diff
diff --git a/src/sync/archive.rs b/src/sync/archive.rs
index b4e78a4..2fdc2e4 100644
--- a/src/sync/archive.rs
+++ b/src/sync/archive.rs
@@ -150,5 +150,6 @@ fn exe_paths(exe_name: &str, asset_name: &str) -> Vec<PathBuf> {
[asset_name, &exe_name].iter().collect(),
[&exe_name].iter().collect(),
["bin", &exe_name].iter().collect(),
+ [asset_name, "bin", &exe_name].iter().collect(),
]
} |
@MitchellBerend Unfortunately,
So it's not enough to specify only this string. Try the following instead: asset_name.linux = "linux_amd64.tar.gz" The error message The logic for finding the asset is here: Lines 79 to 84 in 7700be2
So yes, it does find the first matching asset. It should be improved to find all and report an error early when several assets match the query string (or be smarter and actually select the one that matches). The only difficulty here is that in this mode all errors should be single-line to be present at the same line as the tool name. But proper error-reporting would require spanning an error message on multiple lines. So error-reporting improvement needs some thinking. |
Okay I added the new path option but I also want to expand the scope of this issue to include that error message. |
Resolves #56 I've improved the documentation for `tool-sync` in a few ways: * Rewrote README * Added a CHAGELOG * Slightly changed the CONTRIBUTING.md guide (now it requires to add new changes in the changelog) * Generated a new GIF with the new output * Increased the version to `0.2.0` I want to implement #54 and #55 before actually creating a release so the CHANGELOG will change. But those changes shouldn't affect the documentation so this one can be merged separately. ### Additional tasks - [x] Documentation for changes provided/changed - [ ] Tests added Co-authored-by: Zixuan Zhang <[email protected]>
This is needed for some tools. Example:
All the search paths are specified here:
tool-sync/src/sync/archive.rs
Lines 144 to 153 in cb339b0
To fix this problem:
gh
The text was updated successfully, but these errors were encountered: