Skip to content

Commit f5401a0

Browse files
committed
fix: correct theseus build bundle
1 parent dfdf368 commit f5401a0

File tree

2 files changed

+16
-5
lines changed
  • postgresql_archive/src/configuration/custom
  • postgresql_embedded/build

2 files changed

+16
-5
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
pub mod matcher;
2+
3+
pub use matcher::matcher;

postgresql_embedded/build/bundle.rs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![allow(dead_code)]
22

33
use anyhow::Result;
4-
use postgresql_archive::configuration::custom;
4+
use postgresql_archive::configuration::{custom, theseus};
55
use postgresql_archive::repository::github::repository::GitHub;
66
use postgresql_archive::{VersionReq, matcher};
77
use postgresql_archive::{get_archive, repository};
@@ -24,10 +24,13 @@ pub(crate) async fn stage_postgresql_archive() -> Result<()> {
2424

2525
let releases_url = match env::var("POSTGRESQL_RELEASES_URL") {
2626
Ok(custom_url) if !default_releases_url.is_empty() => {
27-
register_github_repository()?;
27+
register_custom_repository()?;
2828
custom_url
2929
}
30-
_ => default_releases_url,
30+
_ => {
31+
register_theseus_repository()?;
32+
default_releases_url
33+
}
3134
};
3235
println!("PostgreSQL releases URL: {releases_url}");
3336
let postgres_version_req = env::var("POSTGRESQL_VERSION").unwrap_or("*".to_string());
@@ -65,8 +68,14 @@ fn supports_github_url(url: &str) -> postgresql_archive::Result<bool> {
6568
Ok(host.ends_with("github.com"))
6669
}
6770

68-
fn register_github_repository() -> Result<()> {
71+
fn register_custom_repository() -> Result<()> {
72+
repository::registry::register(supports_github_url, Box::new(GitHub::new))?;
73+
matcher::registry::register(supports_github_url, custom::matcher)?;
74+
Ok(())
75+
}
76+
77+
fn register_theseus_repository() -> Result<()> {
6978
repository::registry::register(supports_github_url, Box::new(GitHub::new))?;
70-
matcher::registry::register(supports_github_url, custom::matcher::matcher)?;
79+
matcher::registry::register(supports_github_url, theseus::matcher)?;
7180
Ok(())
7281
}

0 commit comments

Comments
 (0)