#![allow(dead_code)]
use std::io;
use piglog::prelude::*;
use piglog::*;
use fspp::*;
pub fn setup() -> Result<(), io::Error> {
let directories = vec![
base(),
gens(),
];
for i in directories.iter() {
match directory::create(i) {
Ok(_o) => info!("Created directory: {}", i.to_string()),
Err(e) => {
error!("Failed to create directory: {}", i.to_string());
return Err(e);
},
};
}
Ok(())
}
pub fn base_legacy() -> Path {
location::home().unwrap().add_str(".rebos-base")
}
pub fn base() -> Path {
location::state().unwrap().add_str("rebos")
}
pub fn gens() -> Path {
base().add_str("generations")
}
pub fn base_user() -> Path {
location::config().unwrap().add_str("rebos")
}