diff --git a/src/main.rs b/src/main.rs index 4a905d8..91de988 100644 --- a/src/main.rs +++ b/src/main.rs @@ -34,9 +34,21 @@ async fn main() -> gcm::StandardResult { match std::fs::read_dir(config.get("GIT_REPO_LOCAL_DEST").expect("not exist")) { Ok(_) => { info!( - "GIT_REPO `{dest}` already setup", + "GIT_REPO `{dest}` existed, checking if has git", dest = config.get("GIT_REPO_LOCAL_DEST").unwrap() - ) + ); + + match std::fs::read_dir(format!( + "{}/.git", + config.get("GIT_REPO_LOCAL_DEST").expect("not exist") + )) { + Ok(_) => { + info!("GIT REPO already set up!") + } + Err(_) => { + setup_git_repo(config.clone())?; + } + } } Err(_) => { setup_git_repo(config.clone())?;