Revert "Replace std::env::home_dir with dirs::home_dir (#9077)" (#9097)

* Revert "Replace `std::env::home_dir` with `dirs::home_dir` (#9077)"

This reverts commit 7e779327eb.

* Restore some of the changes

* Update parity-common
This commit is contained in:
Pierre Krieger
2018-07-12 13:45:02 +02:00
committed by Marek Kotewicz
parent 01f825b0e1
commit acae643a4a
5 changed files with 30 additions and 46 deletions

View File

@@ -17,12 +17,13 @@
//! Parity upgrade logic
use semver::{Version, SemVerError};
use std::collections::HashMap;
use std::collections::*;
use std::fs::{self, File, create_dir_all};
use std::env;
use std::io;
use std::io::{Read, Write};
use std::path::{PathBuf, Path};
use dir::{DatabaseDirectories, default_data_path, home_dir};
use dir::{DatabaseDirectories, default_data_path};
use dir::helpers::replace_home;
use journaldb::Algorithm;
@@ -105,7 +106,7 @@ fn with_locked_version<F>(db_path: Option<&str>, script: F) -> Result<usize, Err
where F: Fn(&Version) -> Result<usize, Error>
{
let mut path = db_path.map_or({
let mut path = home_dir().expect("Applications should have a home dir");
let mut path = env::home_dir().expect("Applications should have a home dir");
path.push(".parity");
path
}, PathBuf::from);