diff --git a/migra-cli/src/config.rs b/migra-cli/src/config.rs index 20ed933..fc7633a 100644 --- a/migra-cli/src/config.rs +++ b/migra-cli/src/config.rs @@ -80,12 +80,13 @@ fn recursive_find_project_root() -> MigraResult { impl Config { pub fn read(config_path: Option) -> MigraResult { let config_path = match config_path { - Some(mut config_path) if config_path.is_dir() => { - config_path.push(MIGRA_TOML_FILENAME); - Some(config_path) + Some(config_path) if config_path.is_dir() => { + Some(config_path.join(MIGRA_TOML_FILENAME)) } Some(config_path) => Some(config_path), - None => recursive_find_project_root().ok(), + None => recursive_find_project_root() + .map(|path| path.join(MIGRA_TOML_FILENAME)) + .ok(), }; match config_path {