Skip to content

Commit

Permalink
Support query! for cargo-free systems (launchbadge#2927)
Browse files Browse the repository at this point in the history
Co-authored-by: kshramt <[email protected]>
  • Loading branch information
2 people authored and kukabi committed Feb 22, 2024
1 parent 7ffb7e2 commit 3b3a658
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sqlx-macros-core/src/query/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,13 @@ pub fn expand_input<'a>(

// Check SQLX_OFFLINE_DIR, then local .sqlx, then workspace .sqlx.
let dirs = [
env("SQLX_OFFLINE_DIR").ok().map(PathBuf::from),
Some(METADATA.manifest_dir.join(".sqlx")),
Some(METADATA.workspace_root().join(".sqlx")),
|| env("SQLX_OFFLINE_DIR").ok().map(PathBuf::from),
|| Some(METADATA.manifest_dir.join(".sqlx")),
|| Some(METADATA.workspace_root().join(".sqlx")),
];
let Some(data_file_path) = dirs
.iter()
.filter_map(|path| path.as_ref())
.filter_map(|path| path())
.map(|path| path.join(&filename))
.find(|path| path.exists())
else {
Expand Down

0 comments on commit 3b3a658

Please sign in to comment.