summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Simpson <edenofest@gmail.com>2020-11-19 09:52:58 -0500
committerGitHub <noreply@github.com>2020-11-19 17:52:58 +0300
commitc1f0e83cbbe03599f5828d421694399163f16076 (patch)
treeaf9f21a680a865120eab4b4ad9faaaf435977603
parent18a226fe4562a9c80800a3adc23d77f452d1a635 (diff)
downloadalacritty-c1f0e83cbbe03599f5828d421694399163f16076.tar.gz
alacritty-c1f0e83cbbe03599f5828d421694399163f16076.zip
Ignore nonexistent config imports instead of raising an error
Fixes: #4330.
-rw-r--r--CHANGELOG.md4
-rw-r--r--alacritty.yml2
-rw-r--r--alacritty/src/config/mod.rs6
3 files changed, 11 insertions, 1 deletions
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<PathBuf>, 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) => {