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

Function show_status

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

Show hook installation status.

()

Source from the content-addressed store, hash-verified

245
246/// Show hook installation status.
247fn show_status() -> CliResult<()> {
248 let hooks_dir = find_hooks_dir()?;
249
250 for hook_name in HOOK_NAMES {
251 let hook_path = hooks_dir.join(hook_name);
252 let status = if !hook_path.exists() {
253 "not installed"
254 } else {
255 let content = fs::read_to_string(&hook_path).unwrap_or_default();
256 if content.contains(MARKER_BEGIN) {
257 "installed"
258 } else {
259 "exists (no Atomic section)"
260 }
261 };
262 print_info(&format!(" {}: {}", hook_name, status));
263 }
264
265 Ok(())
266}
267
268#[cfg(test)]
269mod 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