mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-08 01:05:47 +00:00
Replace env::dir with dirs crate
This commit is contained in:
@@ -12,6 +12,7 @@ boolean-bitfield = { path = "boolean-bitfield" }
|
|||||||
bytes = ""
|
bytes = ""
|
||||||
crypto-mac = "^0.6.2"
|
crypto-mac = "^0.6.2"
|
||||||
clap = "2.32.0"
|
clap = "2.32.0"
|
||||||
|
dirs = "1.0.3"
|
||||||
ethereum-types = ""
|
ethereum-types = ""
|
||||||
futures = "0.1.23"
|
futures = "0.1.23"
|
||||||
network-libp2p = { path = "network-libp2p" }
|
network-libp2p = { path = "network-libp2p" }
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
use std::{ env, fs };
|
extern crate dirs;
|
||||||
use std::path::PathBuf;
|
|
||||||
|
use std::fs;
|
||||||
|
use std::path::PathBuf;
|
||||||
|
|
||||||
/// Stores the core configuration for this Lighthouse instance.
|
/// Stores the core configuration for this Lighthouse instance.
|
||||||
/// This struct is general, other components may implement more
|
/// This struct is general, other components may implement more
|
||||||
@@ -16,7 +18,7 @@ impl LighthouseConfig {
|
|||||||
/// Build a new lighthouse configuration from defaults.
|
/// Build a new lighthouse configuration from defaults.
|
||||||
pub fn default() -> Self{
|
pub fn default() -> Self{
|
||||||
let data_dir = {
|
let data_dir = {
|
||||||
let home = env::home_dir()
|
let home = dirs::home_dir()
|
||||||
.expect("Unable to determine home dir.");
|
.expect("Unable to determine home dir.");
|
||||||
home.join(DEFAULT_LIGHTHOUSE_DIR)
|
home.join(DEFAULT_LIGHTHOUSE_DIR)
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user