mirror of
https://github.com/alexpasmantier/television.git
synced 2025-06-07 03:55:23 +00:00
fix(config): add serde default for shell integration configuration (#319)
Fixes #318
This commit is contained in:
parent
4b632f81f8
commit
f536156e7e
@ -99,9 +99,9 @@ impl Config {
|
|||||||
let path = config_dir.join(CONFIG_FILE_NAME);
|
let path = config_dir.join(CONFIG_FILE_NAME);
|
||||||
let contents = std::fs::read_to_string(&path)?;
|
let contents = std::fs::read_to_string(&path)?;
|
||||||
|
|
||||||
let cfg: Config = toml::from_str(&contents).unwrap_or_else(|_| {
|
let cfg: Config = toml::from_str(&contents).unwrap_or_else(|e| {
|
||||||
warn!(
|
warn!(
|
||||||
"Error parsing config file, using default configuration"
|
"Error parsing config file, using default configuration: {}" , e
|
||||||
);
|
);
|
||||||
default_config.clone()
|
default_config.clone()
|
||||||
});
|
});
|
||||||
|
@ -4,6 +4,7 @@ use rustc_hash::FxHashMap;
|
|||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
|
|
||||||
#[derive(Clone, Debug, Deserialize, Default)]
|
#[derive(Clone, Debug, Deserialize, Default)]
|
||||||
|
#[serde(default)]
|
||||||
pub struct ShellIntegrationConfig {
|
pub struct ShellIntegrationConfig {
|
||||||
pub commands: FxHashMap<String, String>,
|
pub commands: FxHashMap<String, String>,
|
||||||
pub keybindings: FxHashMap<String, String>,
|
pub keybindings: FxHashMap<String, String>,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user