diff --git a/docs/registry.md b/docs/registry.md index 9e821700db..d7ea8efe4d 100644 --- a/docs/registry.md +++ b/docs/registry.md @@ -680,7 +680,7 @@ You can also specify the full name for a tool using `mise use aqua:1password/cli | sourcery | [asdf:mise-plugins/mise-sourcery](https://github.com/mise-plugins/mise-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:mise-plugins/mise-spring-boot](https://github.com/mise-plugins/mise-spring-boot) | diff --git a/registry.toml b/registry.toml index 12808eeeff..ad056124c3 100644 --- a/registry.toml +++ b/registry.toml @@ -1551,7 +1551,9 @@ soracom.backends = ["ubi:soracom/soracom-cli", "asdf:gr1m0h/asdf-soracom"] sourcery.backends = ["asdf:mise-plugins/mise-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 2>&1", "version {{version}}"] spectral.backends = ["aqua:stoplightio/spectral", "asdf:vbyrd/asdf-spectral"] spin.backends = ["aqua:spinnaker/spin", "asdf:pavloos/asdf-spin"] spring-boot.backends = ["asdf:mise-plugins/mise-spring-boot"] diff --git a/src/aqua/aqua_registry.rs b/src/aqua/aqua_registry.rs index a1731fb4c8..7310d41885 100644 --- a/src/aqua/aqua_registry.rs +++ b/src/aqua/aqua_registry.rs @@ -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() { diff --git a/src/backend/aqua.rs b/src/backend/aqua.rs index b07f8cd347..7327710630 100644 --- a/src/backend/aqua.rs +++ b/src/backend/aqua.rs @@ -49,14 +49,7 @@ impl Backend for AquaBackend { fn _list_remote_versions(&self) -> Result> { 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| { @@ -581,6 +574,21 @@ impl AquaBackend { } } +fn get_versions(pkg: &AquaPackage) -> Result> { + 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();