1
0
Fork 0
mirror of https://github.com/alacritty/alacritty.git synced 2024-11-18 13:55:23 -05:00

Add TOML migration recommendation to warning

This adds a little recommendation to use `alacritty migrate` to
automatically transition configuration files from YAML to TOML.
This commit is contained in:
Christian Duerr 2023-06-26 00:07:41 +02:00 committed by GitHub
parent 43b7c1774c
commit 9fcdb059bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -228,7 +228,9 @@ pub fn deserialize_config(path: &Path) -> Result<Value> {
// Convert YAML to TOML as a transitionary fallback mechanism.
let extension = path.extension().unwrap_or_default();
if (extension == "yaml" || extension == "yml") && !contents.trim().is_empty() {
warn!("YAML config {path:?} is deprecated, please migrate to TOML");
warn!(
"YAML config {path:?} is deprecated, please migrate to TOML using `alacritty migrate`"
);
let value: serde_yaml::Value = serde_yaml::from_str(&contents)?;
contents = toml::to_string(&value)?;