Skip to main content

dre_core/
lib.rs

1//! DRE core: turns a project directory into a resolved, validated project, and runs it.
2
3pub mod codes;
4pub mod coltypes;
5pub mod config;
6pub mod constraints;
7pub mod dates;
8pub mod diag;
9pub mod engine;
10pub mod error;
11pub mod fs;
12pub mod lock;
13pub mod lookups;
14pub mod manager;
15pub mod manifest;
16pub mod message;
17mod mutable;
18pub mod numbers;
19pub mod occurrences;
20pub mod options;
21pub mod packages;
22pub mod parse;
23pub mod plugins;
24pub mod preflight;
25pub mod profiles;
26pub mod project;
27pub mod render;
28pub mod run;
29pub mod run_results;
30pub mod runs;
31pub mod schedule;
32mod schema;
33pub mod secrets;
34pub mod selector;
35pub mod settings;
36pub mod sqlsplit;
37pub mod target;
38pub mod values;
39pub mod yaml;
40
41pub use diag::{Diagnostic, Diagnostics, Severity};
42
43/// The version string `dre --version` prints. DRE has no released version yet.
44pub fn version() -> &'static str {
45    match env!("CARGO_PKG_VERSION") {
46        "0.0.0" => "unreleased",
47        v => v,
48    }
49}
50
51/// DRE's home directory: `~/.dre`.
52pub fn dre_home() -> std::path::PathBuf {
53    std::env::home_dir().unwrap_or_default().join(".dre")
54}
55
56/// A path with `/` separators on every platform, so messages and goldens read the same everywhere.
57pub fn slash(p: &std::path::Path) -> std::path::PathBuf {
58    std::path::PathBuf::from(p.to_string_lossy().replace('\\', "/"))
59}