Files
crete/src/lib.rs
T

31 lines
682 B
Rust

#![feature(impl_trait_in_assoc_type, path_absolute_method)]
use std::path::{Path, PathBuf};
use std::sync::OnceLock;
pub mod cluster;
pub mod environment;
pub mod node;
pub mod patch;
pub mod schematic;
pub mod secret;
pub(crate) static REPO_PATH: OnceLock<PathBuf> = OnceLock::new();
pub fn set_repo_path(path: impl Into<PathBuf>) {
REPO_PATH
.set(path.into())
.expect("Repo path already initialized");
}
pub fn get_repo_path() -> &'static Path {
REPO_PATH.get().expect("Repo path not initialized")
}
pub fn get_talos_path() -> PathBuf {
get_repo_path().join("talos")
}
pub fn get_configs_path() -> PathBuf {
get_repo_path().join("configs")
}