From 3e6c6e513bb7988ad2732c9e73356f1f7489244f Mon Sep 17 00:00:00 2001 From: slowsage <84777606+slowsage@users.noreply.github.com> Date: Tue, 13 Jun 2023 10:17:27 -0400 Subject: [PATCH] fix: handle no topgrade.toml but files in topgrade.d (#460) --- src/config.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/config.rs b/src/config.rs index a8d332a9..c763de43 100644 --- a/src/config.rs +++ b/src/config.rs @@ -602,6 +602,12 @@ impl ConfigFile { path }; + if config_path == PathBuf::default() { + // Here we expect topgrade.d and consequently result is not empty. + // If empty, Self:: ensure() would have created the default config. + return Ok(result); + } + let mut contents_non_split = fs::read_to_string(&config_path).map_err(|e| { tracing::error!("Unable to read {}", config_path.display()); e