From c1f0e83cbbe03599f5828d421694399163f16076 Mon Sep 17 00:00:00 2001 From: James Simpson Date: Thu, 19 Nov 2020 09:52:58 -0500 Subject: Ignore nonexistent config imports instead of raising an error Fixes: #4330. --- CHANGELOG.md | 4 ++++ alacritty.yml | 2 +- alacritty/src/config/mod.rs | 6 ++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 741702ce..e655e9f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## 0.7.0-dev +### Changed + +- Nonexistent config imports are ignored instead of raising an error + ### Fixed - Wide characters sometimes being cut off diff --git a/alacritty.yml b/alacritty.yml index 2c96d23e..cdad3fe1 100644 --- a/alacritty.yml +++ b/alacritty.yml @@ -4,7 +4,7 @@ # # These configuration files will be loaded in order, replacing values in files # loaded earlier with those loaded later in the chain. The file itself will -# always be loaded last. +# always be loaded last. If an import path cannot be found it will be skipped. #import: # - /path/to/alacritty.yml diff --git a/alacritty/src/config/mod.rs b/alacritty/src/config/mod.rs index 9aa2a74c..d24e8519 100644 --- a/alacritty/src/config/mod.rs +++ b/alacritty/src/config/mod.rs @@ -222,6 +222,12 @@ fn load_imports(config: &Value, config_paths: &mut Vec, recursion_limit }, }; + if !path.exists() { + info!(target: LOG_TARGET_CONFIG, "Skipping importing config; not found:"); + info!(target: LOG_TARGET_CONFIG, " {:?}", path.display()); + continue; + } + match parse_config(&path, config_paths, recursion_limit - 1) { Ok(config) => merged = serde_utils::merge(merged, config), Err(err) => { -- cgit v1.2.3-54-g00ecf