File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,13 +37,13 @@ fn ensure_binary_format(url: &str) -> String {
3737}
3838
3939/// Extract the file extension from the response_format query parameter.
40- fn extension_from_url ( url : & str ) -> & str {
40+ fn extension_from_url ( url : & str ) -> Result < & str > {
4141 if url. contains ( "response_format=ipa" ) {
42- "ipa"
42+ Ok ( "ipa" )
4343 } else if url. contains ( "response_format=apk" ) {
44- "apk"
44+ Ok ( "apk" )
4545 } else {
46- "zip"
46+ bail ! ( "Unsupported build format in download URL." )
4747 }
4848}
4949
@@ -71,7 +71,7 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
7171 let output_path = match matches. get_one :: < String > ( "output" ) {
7272 Some ( path) => PathBuf :: from ( path) ,
7373 None => {
74- let ext = extension_from_url ( & download_url) ;
74+ let ext = extension_from_url ( & download_url) ? ;
7575 PathBuf :: from ( format ! ( "preprod_artifact_{build_id}.{ext}" ) )
7676 }
7777 } ;
You can’t perform that action at this time.
0 commit comments