cdk_mintd/
lib.rs

1//! Cdk mintd lib
2
3#[cfg(feature = "cln")]
4use std::path::PathBuf;
5
6pub mod cli;
7pub mod config;
8pub mod env_vars;
9pub mod setup;
10
11#[cfg(feature = "cln")]
12fn expand_path(path: &str) -> Option<PathBuf> {
13    if path.starts_with('~') {
14        if let Some(home_dir) = home::home_dir().as_mut() {
15            let remainder = &path[2..];
16            home_dir.push(remainder);
17            let expanded_path = home_dir;
18            Some(expanded_path.clone())
19        } else {
20            None
21        }
22    } else {
23        Some(PathBuf::from(path))
24    }
25}