Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion path/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ authors = ["Parity Technologies <admin@parity.io>"]
license = "GPL3"

[dependencies]
dirs = "1.0.2"
8 changes: 3 additions & 5 deletions path/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,14 @@
// along with Parity. If not, see <http://www.gnu.org/licenses/>.

//! Path utilities
extern crate dirs;

use std::path::Path;
use std::path::PathBuf;

#[cfg(target_os = "macos")]
/// Get the config path for application `name`.
/// `name` should be capitalized, e.g. `"Ethereum"`, `"Parity"`.
pub fn config_path(name: &str) -> PathBuf {
let mut home = dirs::home_dir().expect("Failed to get home dir");
let mut home = ::std::env::home_dir().expect("Failed to get home dir");
home.push("Library");
home.push(name);
home
Expand All @@ -34,7 +32,7 @@ pub fn config_path(name: &str) -> PathBuf {
/// Get the config path for application `name`.
/// `name` should be capitalized, e.g. `"Ethereum"`, `"Parity"`.
pub fn config_path(name: &str) -> PathBuf {
let mut home = dirs::home_dir().expect("Failed to get home dir");
let mut home = ::std::env::home_dir().expect("Failed to get home dir");
home.push("AppData");
home.push("Roaming");
home.push(name);
Expand All @@ -45,7 +43,7 @@ pub fn config_path(name: &str) -> PathBuf {
/// Get the config path for application `name`.
/// `name` should be capitalized, e.g. `"Ethereum"`, `"Parity"`.
pub fn config_path(name: &str) -> PathBuf {
let mut home = dirs::home_dir().expect("Failed to get home dir");
let mut home = ::std::env::home_dir().expect("Failed to get home dir");
home.push(format!(".{}", name.to_lowercase()));
home
}
Expand Down