Skip to content

Commit

Permalink
Support query! for cargo-free systems (#2927)
Browse files Browse the repository at this point in the history
Co-authored-by: kshramt <kshramt@example.com>
  • Loading branch information
kshramt and kshramt authored Jan 18, 2024
1 parent 2cc3e0f commit b4269b7
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 b4269b7

Please sign in to comment.