// use crate::model::Config; use crate::patterns::issue_pattern; use crate::printer::Printer; use anyhow::{Context, Result}; use kxio::{fs::FileSystem, net::Net}; pub fn init_config<'net, 'fs>( printer: &impl Printer, fs: &'fs FileSystem, net: &'net Net, ) -> Result> { let config = Config::builder() .net(net) .fs(fs) .repo(std::env::var("GITHUB_REPOSITORY").context("GITHUB_REPOSITORY")?) .server(std::env::var("GITHUB_SERVER_URL").context("GITHUB_SERVER_URL")?) .issue_pattern(issue_pattern()?) .maybe_auth_token(std::env::var("REPO_TOKEN").ok()) .build(); printer.println(""); printer.println(format!("Repo : {}", config.repo())); printer.println(format!("Regex: {}", config.issue_pattern())); printer.println(""); Ok(config) }