@@ -853,6 +853,7 @@ fn generate_binaries_data(settings: &Settings) -> crate::Result<Vec<Binary>> {
853853 let mut binaries = Vec :: new ( ) ;
854854 let cwd = std:: env:: current_dir ( ) ?;
855855 let tmp_dir = std:: env:: temp_dir ( ) ;
856+ let regex = Regex :: new ( r"[^\w\d\.]" ) ?;
856857 for src in settings. external_binaries ( ) {
857858 let src = src?;
858859 let binary_path = cwd. join ( & src) ;
@@ -861,7 +862,7 @@ fn generate_binaries_data(settings: &Settings) -> crate::Result<Vec<Binary>> {
861862 . expect ( "failed to extract external binary filename" )
862863 . to_string_lossy ( )
863864 . replace ( & format ! ( "-{}" , settings. target( ) ) , "" ) ;
864- let dest = tmp_dir. join ( dest_filename) ;
865+ let dest = tmp_dir. join ( & dest_filename) ;
865866 std:: fs:: copy ( binary_path, & dest) ?;
866867
867868 binaries. push ( Binary {
@@ -870,7 +871,9 @@ fn generate_binaries_data(settings: &Settings) -> crate::Result<Vec<Binary>> {
870871 . into_os_string ( )
871872 . into_string ( )
872873 . expect ( "failed to read external binary path" ) ,
873- id : format ! ( "I{}" , Uuid :: new_v4( ) . as_simple( ) ) ,
874+ id : regex
875+ . replace_all ( & dest_filename. replace ( '-' , "_" ) , "" )
876+ . to_string ( ) ,
874877 } ) ;
875878 }
876879
@@ -883,7 +886,9 @@ fn generate_binaries_data(settings: &Settings) -> crate::Result<Vec<Binary>> {
883886 . into_os_string ( )
884887 . into_string ( )
885888 . expect ( "failed to read binary path" ) ,
886- id : format ! ( "I{}" , Uuid :: new_v4( ) . as_simple( ) ) ,
889+ id : regex
890+ . replace_all ( & bin. name ( ) . replace ( '-' , "_" ) , "" )
891+ . to_string ( ) ,
887892 } )
888893 }
889894 }
0 commit comments