-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat(http): add rename_exe support for archive extraction #7874
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
Changes from 1 commit
839ddff
5b95740
ca5cba6
de7477c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -3,7 +3,7 @@ use crate::backend::VersionInfo; | |||||||
| use crate::backend::backend_type::BackendType; | ||||||||
| use crate::backend::static_helpers::{ | ||||||||
| clean_binary_name, get_filename_from_url, list_available_platforms_with_key, | ||||||||
| lookup_platform_key, template_string, verify_artifact, | ||||||||
| lookup_platform_key, rename_executable_in_dir, template_string, verify_artifact, | ||||||||
| }; | ||||||||
| use crate::backend::version_list; | ||||||||
| use crate::cli::args::BackendArg; | ||||||||
|
|
@@ -397,6 +397,23 @@ impl HttpBackend { | |||||||
| }; | ||||||||
|
|
||||||||
| file::untar(file_path, dest, &tar_opts)?; | ||||||||
|
|
||||||||
| // Handle rename_exe option for archives | ||||||||
| if let Some(rename_to) = get_opt(opts, "rename_exe") { | ||||||||
| let search_dir = if let Some(bin_path) = get_opt(opts, "bin_path") { | ||||||||
| dest.join(&bin_path) | ||||||||
| } else { | ||||||||
| dest.to_path_buf() | ||||||||
| }; | ||||||||
|
cursor[bot] marked this conversation as resolved.
|
||||||||
| let tool_name = self | ||||||||
| .ba | ||||||||
| .tool_name | ||||||||
| .rsplit('/') | ||||||||
| .next() | ||||||||
| .unwrap_or(&self.ba.tool_name); | ||||||||
|
||||||||
| .unwrap_or(&self.ba.tool_name); | |
| // `rsplit` on a non-empty string always yields at least one element | |
| .expect("rsplit('/') on tool_name should always yield at least one segment"); |
Uh oh!
There was an error while loading. Please reload this page.