summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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) => {