MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / show_status

Function show_status

atomic-cli/src/commands/git/hooks.rs:226–245  ·  view source on GitHub ↗

Show hook installation status.

()

Source from the content-addressed store, hash-verified

224
225/// Show hook installation status.
226fn show_status() -> CliResult<()> {
227 let hooks_dir = find_hooks_dir()?;
228
229 for hook_name in HOOK_NAMES {
230 let hook_path = hooks_dir.join(hook_name);
231 let status = if !hook_path.exists() {
232 "not installed"
233 } else {
234 let content = fs::read_to_string(&hook_path).unwrap_or_default();
235 if content.contains(MARKER_BEGIN) {
236 "installed"
237 } else {
238 "exists (no Atomic section)"
239 }
240 };
241 print_info(&format!(" {}: {}", hook_name, status));
242 }
243
244 Ok(())
245}
246
247#[cfg(test)]
248mod tests {

Callers 1

runMethod · 0.85

Calls 4

find_hooks_dirFunction · 0.85
print_infoFunction · 0.85
existsMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected