| 105 | } |
| 106 | |
| 107 | fn hooks_installed(&self) -> Vec<String> { |
| 108 | let mut hooks: Vec<String> = fs::read_dir(self.root().join(".git/hooks")) |
| 109 | .map(|entries| { |
| 110 | entries |
| 111 | .filter_map(Result::ok) |
| 112 | .map(|entry| entry.file_name().to_string_lossy().into_owned()) |
| 113 | .filter(|name| !name.ends_with(".sample")) |
| 114 | .collect() |
| 115 | }) |
| 116 | .unwrap_or_default(); |
| 117 | hooks.sort(); |
| 118 | hooks |
| 119 | } |
| 120 | |
| 121 | /// Run one OpenCode agent hook dispatch the way the atomic-opencode |
| 122 | /// plugin does: JSON on stdin, foreground, from the repository root. |