add bare cli
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
use std::{
|
||||
env::current_dir,
|
||||
sync::{Arc, Mutex},
|
||||
};
|
||||
|
||||
use config::CuddleConfig;
|
||||
|
||||
mod actions;
|
||||
@@ -11,8 +16,16 @@ fn main() -> anyhow::Result<()> {
|
||||
|
||||
let config = CuddleConfig::from_env()?;
|
||||
|
||||
let context = context::extract_cuddle(config.clone())?;
|
||||
_ = cli::CuddleCli::new(context)?.execute()?;
|
||||
match git2::Repository::open(current_dir()?) {
|
||||
Ok(_) => {
|
||||
let context = context::extract_cuddle(config.clone())?;
|
||||
_ = cli::CuddleCli::new(context)?.execute()?;
|
||||
}
|
||||
Err(_) => {
|
||||
// Only build bare bones cli
|
||||
_ = cli::CuddleCli::new(Arc::new(Mutex::new(vec![])))?.execute()?;
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
Reference in New Issue
Block a user