testing conditional compilation

This commit is contained in:
rabite 2019-05-08 14:06:10 +02:00
parent e8d9c6ad1f
commit 8a997042d3
1 changed files with 11 additions and 0 deletions

View File

@ -15,12 +15,23 @@ pub fn ranger_path() -> HResult<PathBuf> {
Ok(ranger_path)
}
#[cfg(not(target_os = "macos"))]
pub fn hunter_path() -> HResult<PathBuf> {
let mut hunter_path = dirs_2::config_dir()?;
hunter_path.push("hunter/");
Ok(hunter_path)
}
#[cfg(target_os = "macos")]
pub fn hunter_path() -> HResult<PathBuf> {
dbg!("Finding path for macOS");
let mut hunter_path = home_path()?;
hunter_path.push(".config/");
hunter_path.push("hunter/");
dbg!(&hunter_path);
Ok(hunter_path)
}
pub fn config_path() -> HResult<PathBuf> {
let mut config_path = hunter_path()?;
config_path.push("config");