From a29c65a9a7ac35978760be6d6996a865020186c2 Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Thu, 25 Mar 2021 00:41:22 +0300 Subject: [PATCH] fix: find exists manifest --- migra-cli/src/config.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 {