(&self, client: &Client)
| 11 | |
| 12 | impl LeakedData { |
| 13 | pub fn call(&self, client: &Client) -> Result<Vec<(RepoId, String)>> { |
| 14 | let root = client.root.path.to_owned(); |
| 15 | let repos = self.repos(&root)?; |
| 16 | env::set_current_dir(&root)?; |
| 17 | |
| 18 | let mut leaks = vec![]; |
| 19 | for repo in repos { |
| 20 | let output = Command::new("grep") |
| 21 | .arg("-rl") |
| 22 | .arg(repo.to_string()) |
| 23 | .arg(".") |
| 24 | .output()?; |
| 25 | let pat = format!(".{repo}"); |
| 26 | |
| 27 | let result = String::from_utf8(output.stdout)?; |
| 28 | for line in result.lines() { |
| 29 | if !line.starts_with(&pat) { |
| 30 | leaks.push((repo.to_owned(), line.to_owned())); |
| 31 | } |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | Ok(leaks) |
| 36 | } |
| 37 | |
| 38 | fn repos(&self, root: &PathBuf) -> Result<Vec<RepoId>> { |
| 39 | let paths = fs::read_dir(root)?; |
nothing calls this directly
no test coverage detected