MCPcopy Create free account
hub / github.com/alt-art/commit / get_pattern

Function get_pattern

src/config/mod.rs:57–72  ·  view source on GitHub ↗
(config_path: Option<PathBuf>)

Source from the content-addressed store, hash-verified

55}
56
57pub fn get_pattern(config_path: Option<PathBuf>) -> Result<CommitPattern> {
58 let selected_config_path = select_custom_config_path(config_path)?;
59 if selected_config_path.exists() {
60 let file = File::open(&selected_config_path).context(format!(
61 "Could not open config file: {}",
62 selected_config_path.display()
63 ))?;
64 let reader = std::io::BufReader::new(file);
65 Ok(serde_json::from_reader(reader).context(format!(
66 "Could not parse config file: {}",
67 selected_config_path.display()
68 ))?)
69 } else {
70 Ok(CommitPattern::default())
71 }
72}

Callers 2

mainFunction · 0.85
get_pattern_testFunction · 0.85

Calls 1

Tested by 1

get_pattern_testFunction · 0.68