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