File tree Expand file tree Collapse file tree
crates/blockifier_test_utils/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,13 +54,19 @@ async fn download_cairo_package(version: &String) {
5454 let filename = "release-x86_64-unknown-linux-musl.tar.gz" ;
5555 let package_url =
5656 format ! ( "https://github.com/starkware-libs/cairo/releases/download/v{version}/{filename}" ) ;
57- let curl_command =
58- Command :: new ( "curl" ) . args ( [ "-L" , & package_url] ) . stdout ( Stdio :: piped ( ) ) . spawn ( ) . unwrap ( ) ;
59- run_and_verify_output (
60- Command :: new ( "tar" )
61- . args ( [ "-xz" , "-C" , directory. to_str ( ) . unwrap ( ) ] )
62- . stdin ( Stdio :: from ( curl_command. stdout . unwrap ( ) ) ) ,
63- ) ;
57+ let curl_result = run_and_verify_output ( Command :: new ( "curl" ) . args ( [ "-L" , & package_url] ) ) ;
58+ let mut tar_command = Command :: new ( "tar" )
59+ . args ( [ "-xz" , "-C" , directory. to_str ( ) . unwrap ( ) ] )
60+ . stdin ( Stdio :: piped ( ) )
61+ . spawn ( )
62+ . unwrap ( ) ;
63+ let tar_command_stdin = tar_command. stdin . as_mut ( ) . unwrap ( ) ;
64+ tar_command_stdin. write_all ( & curl_result. stdout ) . unwrap ( ) ;
65+ let output = tar_command. wait_with_output ( ) . unwrap ( ) ;
66+ if !output. status . success ( ) {
67+ let stderr_output = String :: from_utf8 ( output. stderr ) . unwrap ( ) ;
68+ panic ! ( "{stderr_output}" ) ;
69+ }
6470 info ! ( "Done." ) ;
6571}
6672
You can’t perform that action at this time.
0 commit comments