Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/registry.md
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ You can also specify the full name for a tool using `mise use aqua:1password/cli
| sourcery | [asdf:younke/asdf-sourcery](https://github.com/younke/asdf-sourcery) |
| spacectl | [aqua:spacelift-io/spacectl](https://github.com/spacelift-io/spacectl) [asdf:bodgit/asdf-spacectl](https://github.com/bodgit/asdf-spacectl) |
| spago | [ubi:purescript/spago](https://github.com/purescript/spago) [asdf:jrrom/asdf-spago](https://github.com/jrrom/asdf-spago) |
| spark | [asdf:mise-plugins/mise-spark](https://github.com/mise-plugins/mise-spark) |
| spark | [aqua:apache/spark](https://github.com/apache/spark) [asdf:mise-plugins/mise-spark](https://github.com/mise-plugins/mise-spark) |
| spectral | [aqua:stoplightio/spectral](https://github.com/stoplightio/spectral) [asdf:vbyrd/asdf-spectral](https://github.com/vbyrd/asdf-spectral) |
| spin | [aqua:spinnaker/spin](https://github.com/spinnaker/spin) [asdf:pavloos/asdf-spin](https://github.com/pavloos/asdf-spin) |
| spring-boot | [asdf:joschi/asdf-spring-boot](https://github.com/joschi/asdf-spring-boot) |
Expand Down
4 changes: 3 additions & 1 deletion registry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1546,7 +1546,9 @@ soracom.backends = ["ubi:soracom/soracom-cli", "asdf:gr1m0h/asdf-soracom"]
sourcery.backends = ["asdf:younke/asdf-sourcery"]
spacectl.backends = ["aqua:spacelift-io/spacectl", "asdf:bodgit/asdf-spacectl"]
spago.backends = ["ubi:purescript/spago", "asdf:jrrom/asdf-spago"]
spark.backends = ["asdf:mise-plugins/mise-spark"]
spark.backends = ["aqua:apache/spark", "asdf:mise-plugins/mise-spark"]
spark.depends = ["java"]
spark.test = ["spark-shell --version", "version {{version}}"]
spectral.backends = ["aqua:stoplightio/spectral", "asdf:vbyrd/asdf-spectral"]
spin.backends = ["aqua:spinnaker/spin", "asdf:pavloos/asdf-spin"]
spring-boot.backends = ["asdf:joschi/asdf-spring-boot"]
Expand Down
2 changes: 1 addition & 1 deletion src/aqua/aqua_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ impl AquaFile {
}

fn apply_override(mut orig: AquaPackage, avo: &AquaPackage) -> AquaPackage {
if orig.r#type != avo.r#type {
if avo.r#type != AquaPackageType::GithubRelease {
orig.r#type = avo.r#type.clone();
}
if !avo.repo_owner.is_empty() {
Expand Down
24 changes: 16 additions & 8 deletions src/backend/aqua.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,7 @@ impl Backend for AquaBackend {
fn _list_remote_versions(&self) -> Result<Vec<String>> {
let pkg = AQUA_REGISTRY.package(&self.id)?;
if !pkg.repo_owner.is_empty() && !pkg.repo_name.is_empty() {
let versions = if let Some("github_tag") = pkg.version_source.as_deref() {
github::list_tags(&format!("{}/{}", pkg.repo_owner, pkg.repo_name))?
} else {
github::list_releases(&format!("{}/{}", pkg.repo_owner, pkg.repo_name))?
.into_iter()
.map(|r| r.tag_name)
.collect_vec()
};
let versions = get_versions(&pkg)?;
Ok(versions
.into_iter()
.filter_map(|v| {
Expand Down Expand Up @@ -581,6 +574,21 @@ impl AquaBackend {
}
}

fn get_versions(pkg: &AquaPackage) -> Result<Vec<String>> {
if let Some("github_tag") = pkg.version_source.as_deref() {
let versions = github::list_tags(&format!("{}/{}", pkg.repo_owner, pkg.repo_name))?;
return Ok(versions);
}
let mut versions = github::list_releases(&format!("{}/{}", pkg.repo_owner, pkg.repo_name))?
.into_iter()
.map(|r| r.tag_name)
.collect_vec();
if versions.is_empty() {
versions = github::list_tags(&format!("{}/{}", pkg.repo_owner, pkg.repo_name))?;
}
Ok(versions)
}

fn validate(pkg: &AquaPackage) -> Result<()> {
let envs: HashSet<&str> = pkg.supported_envs.iter().map(|s| s.as_str()).collect();
let os = os();
Expand Down
Loading