File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ use log::{debug, info};
44use std:: fmt;
55use std:: fs;
66use std:: io:: { self , Read } ;
7- use std:: path:: { Path , PathBuf } ;
7+ use std:: path:: PathBuf ;
88
99pub enum DownloadError {
1010 IncompatibleOS ,
@@ -121,18 +121,20 @@ fn write_micromamba<R: Read>(
121121fn find_micromamba_in_archive < ' a , R : Read > (
122122 tar_archive : & ' a mut tar:: Archive < R > ,
123123) -> Result < tar:: Entry < ' a , R > , DownloadError > {
124- let archive_binary_path = if cfg ! ( target_os = "linux" ) {
125- Path :: new ( "bin" ) . join ( "micromamba ")
124+ let archive_binary_dir = if cfg ! ( target_os = "linux" ) {
125+ PathBuf :: from ( "bin" )
126126 } else if cfg ! ( target_os = "windows" ) {
127- Path :: new ( "Library" ) . join ( "bin" ) . join ( "micromamba.exe ")
127+ PathBuf :: from ( "Library" ) . join ( "bin" )
128128 } else {
129129 return Err ( DownloadError :: IncompatibleOS ) ;
130130 } ;
131131
132+ let micromamba_exe = micromamba_executable_name ( ) ?;
133+
132134 for entry in tar_archive. entries ( ) ? {
133135 let entry = entry?;
134136 if let Ok ( path) = entry. path ( )
135- && path == archive_binary_path
137+ && path == archive_binary_dir . join ( micromamba_exe )
136138 {
137139 return Ok ( entry) ;
138140 }
You can’t perform that action at this time.
0 commit comments