without autoescape

This commit is contained in:
2022-08-14 20:19:29 +02:00
parent 49089b3074
commit 319360968b
17 changed files with 1083 additions and 332 deletions

View File

@@ -1,8 +1,3 @@
use std::{
env::current_dir,
sync::{Arc, Mutex},
};
use config::CuddleConfig;
use tracing::Level;
@@ -11,23 +6,15 @@ mod cli;
mod config;
mod context;
mod model;
mod util;
fn main() -> anyhow::Result<()> {
init_logging()?;
let config = CuddleConfig::from_env()?;
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
log::info!("was not opened in a repo with git, only showing bare-bones options");
_ = cli::CuddleCli::new(Arc::new(Mutex::new(vec![])))?.execute()?;
}
}
let context = context::extract_cuddle(config.clone())?;
_ = cli::CuddleCli::new(context)?.execute()?;
Ok(())
}
@@ -35,7 +22,7 @@ fn main() -> anyhow::Result<()> {
fn init_logging() -> anyhow::Result<()> {
tracing_subscriber::fmt()
.pretty()
.with_max_level(Level::DEBUG)
.with_max_level(Level::INFO)
.init();
Ok(())