aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Chibisov <contact@kchibisov.com>2024-11-28 16:07:41 +0300
committerChristian Duerr <contact@christianduerr.com>2024-12-22 23:22:32 +0000
commitbf77ac52181e5cceb15a9f06997df2bd76b97994 (patch)
tree45203c6321bccab09eccf33ae4ca067dc60956ef
parent21657d2d4bf66932b26c9e222ba59ded5eb00e12 (diff)
downloadalacritty-bf77ac52181e5cceb15a9f06997df2bd76b97994.tar.gz
alacritty-bf77ac52181e5cceb15a9f06997df2bd76b97994.zip
Don't error on nonexistent TOML imports in migrate
YAML import migration was already properly ignoring nonexistent imports, it was only missed for TOML ones. Fixes #8330.
-rw-r--r--CHANGELOG.md1
-rw-r--r--alacritty/src/migrate/mod.rs8
2 files changed, 9 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 45a826ec..0bdea611 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -16,6 +16,7 @@ Notable changes to the `alacritty_terminal` crate are documented in its
- Hint launcher opening arbitrary text, when terminal content changed while opening
- `SemanticRight`/`SemanticLeft` vi motions breaking with wide semantic escape characters
- `alacritty migrate` crashing with recursive toml imports
+- Migrating nonexistent toml import breaking the entire migration
## 0.14.0
diff --git a/alacritty/src/migrate/mod.rs b/alacritty/src/migrate/mod.rs
index ffba25f0..bfa72294 100644
--- a/alacritty/src/migrate/mod.rs
+++ b/alacritty/src/migrate/mod.rs
@@ -151,6 +151,14 @@ fn migrate_imports(
// Migrate each import.
for import in imports.into_iter().filter_map(|item| item.as_str()) {
let normalized_path = config::normalize_import(path, import);
+
+ if !normalized_path.exists() {
+ if options.dry_run {
+ println!("Skipping migration for nonexistent path: {}", normalized_path.display());
+ }
+ continue;
+ }
+
let migration = migrate_config(options, &normalized_path, recursion_limit - 1)?;
if options.dry_run {
println!("{}", migration.success_message(true));