mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-12-28 03:33:37 +00:00
macros-core: give SQLX_OFFLINE_DIR from environment precedence (#3962)
We need to be able to supply this variable via the environment when built via Nix Crane, which uses cargo vendor, which will filter the .sqlx path. Renaming is necessary in that case.
This commit is contained in:
parent
c825bd36b5
commit
fb6b13eee2
@ -124,6 +124,8 @@ fn init_metadata(manifest_dir: &String) -> crate::Result<Metadata> {
|
||||
.map(|s| s.eq_ignore_ascii_case("true") || s == "1")
|
||||
.unwrap_or(false);
|
||||
|
||||
let offline_dir = env("SQLX_OFFLINE_DIR").ok().or(offline_dir);
|
||||
|
||||
let config = Config::try_from_crate_or_default()?;
|
||||
|
||||
let database_url = env(config.common.database_url_var()).ok().or(database_url);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user