mockforge-collab 0.3.1

Cloud collaboration features for MockForge - team workspaces, real-time sync, and version control
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Build script for mockforge-collab
// Automatically enables SQLx offline mode if .sqlx directory exists
// This allows the crate to compile without a database connection when installed from crates.io

fn main() {
    // Get the crate root directory (where Cargo.toml is located)
    let manifest_dir =
        std::env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR should be set by cargo");
    let sqlx_dir = std::path::Path::new(&manifest_dir).join(".sqlx");

    // Check if .sqlx directory exists in the crate root
    if sqlx_dir.exists() && sqlx_dir.is_dir() {
        // Enable SQLx offline mode
        println!("cargo:rustc-env=SQLX_OFFLINE=true");
    }
}