From 79e4a3a56e2f01a83ffc470c664e1b571fcab0c3 Mon Sep 17 00:00:00 2001 From: Nikolay Volf Date: Tue, 18 Oct 2016 17:44:40 +0300 Subject: [PATCH] fix issues with no test dir present (#2659) --- parity/configuration.rs | 8 ++++---- util/src/path.rs | 7 +++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/parity/configuration.rs b/parity/configuration.rs index e829b9721c4..d5063360f1b 100644 --- a/parity/configuration.rs +++ b/parity/configuration.rs @@ -552,10 +552,10 @@ impl Configuration { let dapps_path = replace_home(&self.args.flag_dapps_path); let signer_path = replace_home(&self.args.flag_signer_path); - if self.args.flag_geth { - let geth_path = path::ethereum::default(); - ::std::fs::create_dir_all(geth_path.as_path()).unwrap_or_else( - |e| warn!("Failed to create '{}' for geth mode: {}", &geth_path.to_str().unwrap(), e)); + if self.args.flag_geth && !cfg!(windows) { + let geth_root = if self.args.flag_testnet { path::ethereum::test() } else { path::ethereum::default() }; + ::std::fs::create_dir_all(geth_root.as_path()).unwrap_or_else( + |e| warn!("Failed to create '{}' for geth mode: {}", &geth_root.to_str().unwrap(), e)); } Directories { diff --git a/util/src/path.rs b/util/src/path.rs index 3a317e02387..8a91a31785a 100644 --- a/util/src/path.rs +++ b/util/src/path.rs @@ -62,6 +62,13 @@ pub mod ethereum { /// Default path for ethereum installation on Mac Os pub fn default() -> PathBuf { super::config_path("Ethereum") } + /// Default path for ethereum installation (testnet) + pub fn test() -> PathBuf { + let mut path = default(); + path.push("testnet"); + path + } + /// Get the specific folder inside default ethereum installation pub fn with_default(s: &str) -> PathBuf { let mut path = default();