sync
This commit is contained in:
parent
b31dcc3235
commit
e633f34765
@ -34,10 +34,13 @@ impl Config {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn from_env() -> Result<Self, SettingError> {
|
pub fn from_env() -> Result<Self, SettingError> {
|
||||||
if let Some(dir_path) = env::var("RSP_CONFIG")
|
if let Some(dir_path) =
|
||||||
|
std::env::current_dir().ok().or(
|
||||||
|
env::var("RSP_CONFIG")
|
||||||
.ok()
|
.ok()
|
||||||
.map(|x| PathBuf::from(x))
|
.map(|x| PathBuf::from(x))
|
||||||
.or(dirs::config_dir())
|
.or(dirs::config_dir())
|
||||||
|
)
|
||||||
{
|
{
|
||||||
let path = dir_path.join("rsp.toml");
|
let path = dir_path.join("rsp.toml");
|
||||||
println!("{:?}", path);
|
println!("{:?}", path);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user