Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
konomae committed Jul 1, 2024
1 parent 67057b3 commit a12bcdb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ pub fn download_prebuilt(
};

let directory = match &version {
VersionSpec::Version(v) if !v.build.is_empty() => "builds".to_string(),
VersionSpec::Semantic(v) if !v.build.is_empty() => "builds".to_string(),
_ => format!("download/{version}"),
};

Expand Down Expand Up @@ -97,9 +97,10 @@ pub fn load_versions(Json(_): Json<LoadVersionsInput>) -> FnResult<Json<LoadVers
versions.push(response.master.version.clone());

let mut output = LoadVersionsOutput::from(versions)?;
output
.aliases
.insert("master".into(), Version::parse(&response.master.version)?);
output.aliases.insert(
"master".into(),
UnresolvedVersionSpec::parse(&response.master.version)?,
);

Ok(Json(output))
}
10 changes: 9 additions & 1 deletion tests/versions_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,13 @@ fn sets_master_alias() {
let output = plugin.load_versions(LoadVersionsInput::default());

assert!(output.aliases.contains_key("latest"));
assert!(!output.aliases.get("master").unwrap().build.is_empty());
assert!(!output
.aliases
.get("master")
.unwrap()
.to_resolved_spec()
.as_version()
.unwrap()
.build
.is_empty());
}

0 comments on commit a12bcdb

Please sign in to comment.