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