Compare commits
1 Commits
c228c64f4c
...
df731f4fec
| Author | SHA1 | Date | |
|---|---|---|---|
| df731f4fec |
@ -196,14 +196,30 @@ impl Config {
|
||||
}
|
||||
|
||||
fn config_path() -> Result<String, Error> {
|
||||
match std::env::var("DETEE_API_USER_PATH") {
|
||||
Ok(user_path) => {
|
||||
let config_path = format!("{user_path}/cli-config.yaml");
|
||||
Ok(config_path)
|
||||
}
|
||||
_ => {
|
||||
let config_path = Self::cli_dir_path()? + ("/cli-config.yaml");
|
||||
Ok(config_path)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn detee_wallet_key_path() -> Result<String, Error> {
|
||||
match std::env::var("DETEE_API_USER_PATH") {
|
||||
Ok(user_path) => {
|
||||
let config_path = format!("{user_path}/secret_detee_wallet_key");
|
||||
Ok(config_path)
|
||||
}
|
||||
_ => {
|
||||
let config_path = Self::cli_dir_path()? + ("/secret_detee_wallet_key");
|
||||
Ok(config_path)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn load_config_from_file() -> Result<Self, Error> {
|
||||
Ok(serde_yaml::from_str(&std::fs::read_to_string(Self::config_path()?)?)?)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user