Skip to content

Commit

Permalink
Fix config
Browse files Browse the repository at this point in the history
  • Loading branch information
SupernaviX committed Sep 18, 2024
1 parent e8e49af commit be0121c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ GUI:
gastronomy
```

### Configuration.

The app will read configuration from environment variables, or from a `.gastronomyrc.toml` file in your home directory.
|Setting|Environment variable|Description|
|---|---|---|
|`blockfrost.key`|`BLOCKFROST_KEY`|The API key to use when querying Blockfrost.|

## Features

Below you will find the planned and completed features for the Gastronomy debugger:
Expand Down
4 changes: 3 additions & 1 deletion gastronomy-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ enum Commands {
}

fn load_config() -> Result<Config> {
let config = load_base_config().merge(Env::raw().split("_")).extract()?;
let config = load_base_config()
.merge(Env::raw().ignore(&["BLOCKFROST"]).split("_"))
.extract()?;
Ok(config)
}

Expand Down
2 changes: 1 addition & 1 deletion gastronomy-ui/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ fn load_config(app_handle: &tauri::AppHandle) -> Result<Config, InvokeError> {
figment = figment.merge(Serialized::defaults(saved));
}
let config = figment
.merge(Env::raw())
.merge(Env::raw().ignore(&["BLOCKFROST"]).split("_"))
.extract()
.map_err(|e| InvokeError::from(e.to_string()))?;
Ok(config)
Expand Down

0 comments on commit be0121c

Please sign in to comment.