Skip to content

Commit

Permalink
download to directory not filename (#2777)
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-bonez authored Nov 8, 2024
1 parent 1c90303 commit 279c732
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion core/startos/src/registry/os/asset/get.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,15 @@ async fn cli_get_os_asset(
..
}: HandlerArgs<CliContext, CliGetOsAssetParams>,
) -> Result<RegistryAsset<Blake3Commitment>, Error> {
let ext = method
.iter()
.last()
.or_else(|| parent_method.iter().last())
.unwrap_or(&"bin");

let res = from_value::<RegistryAsset<Blake3Commitment>>(
ctx.call_remote::<RegistryContext>(
&parent_method.into_iter().chain(method).join("."),
&parent_method.iter().chain(&method).join("."),
json!({
"version": version,
"platform": platform,
Expand All @@ -152,6 +158,7 @@ async fn cli_get_os_asset(
res.validate(SIG_CONTEXT, res.all_signers())?;

if let Some(download) = download {
let download = download.join(format!("startos-{version}_{platform}.{ext}"));
let mut file = AtomicFile::new(&download, None::<&Path>)
.await
.with_kind(ErrorKind::Filesystem)?;
Expand Down

0 comments on commit 279c732

Please sign in to comment.