Skip to content

Commit fc5832a

Browse files
runningcodeclaude
andcommitted
fix(build): Error on unsupported download format
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 38241aa commit fc5832a

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/commands/build/download.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff 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
};

0 commit comments

Comments
 (0)