mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-04-28 03:00:18 -04:00
create util module & create join_config_path function
This commit is contained in:
@@ -21,6 +21,7 @@ pub mod tx;
|
||||
pub mod vm;
|
||||
pub mod vm_serial;
|
||||
pub mod wallet;
|
||||
pub mod util;
|
||||
|
||||
pub use crate::bls_extensions::BlsStringConversion;
|
||||
pub use crate::error::{Error, Result};
|
||||
|
||||
14
src/util.rs
Normal file
14
src/util.rs
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
use crate::Error;
|
||||
use crate::Result;
|
||||
|
||||
use std::path::PathBuf;
|
||||
|
||||
pub fn join_config_path(file: &PathBuf) -> Result<PathBuf> {
|
||||
let mut path = dirs::home_dir()
|
||||
.ok_or(Error::PathNotFound)?
|
||||
.as_path()
|
||||
.join(".config/darkfi/");
|
||||
path.push(file);
|
||||
Ok(path)
|
||||
}
|
||||
Reference in New Issue
Block a user