Better error handling.
This commit is contained in:
parent
64af383fc6
commit
1d61c2b439
@ -74,11 +74,10 @@ fn main()
|
||||
let opts = Opts::from_args();
|
||||
let mut hmgr = HabitMgr::new();
|
||||
|
||||
let mut data_dir = PathBuf::from(
|
||||
env::var("XDG_DATA_HOME")
|
||||
.unwrap_or("./".to_string()));
|
||||
// TODO: don't add this if we use ./
|
||||
data_dir.push("htracker");
|
||||
let data_dir:PathBuf = match env::var("XDG_DATA_HOME") {
|
||||
Ok(s) => [ s, "htracker".to_string() ].iter().collect(),
|
||||
Err(_e) => PathBuf::from("./"),
|
||||
};
|
||||
|
||||
if !data_dir.exists()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user