Skip to content

Instantly share code, notes, and snippets.

@dEajL3kA
Created September 21, 2024 21:15
Show Gist options
  • Save dEajL3kA/6e4981a40223ed567f8ee5b298d48119 to your computer and use it in GitHub Desktop.
Save dEajL3kA/6e4981a40223ed567f8ee5b298d48119 to your computer and use it in GitHub Desktop.
Debug outputs
// DEBUG DOCS_RS
if let Ok(list) = fs::read_dir("/usr/lib/x86_64-linux-gnu") {
eprintln!("[/usr/lib/x86_64-linux-gnu]");
for entry in list {
if let Ok(file) = entry {
let name = file.file_name().into_string().unwrap_or_default();
if name.to_ascii_lowercase().contains("tss") {
eprintln!("{}", name);
}
}
}
eprintln!();
}
if let Ok(list) = fs::read_dir("/usr/lib/x86_64-linux-gnu/pkgconfig") {
eprintln!("[/usr/lib/x86_64-linux-gnu/pkgconfig]");
for entry in list {
if let Ok(file) = entry {
let name = file.file_name().into_string().unwrap_or_default();
if name.to_ascii_lowercase().contains("tss") {
eprintln!("{}", name);
}
}
}
eprintln!();
}
if let Ok(output) = std::process::Command::new("pkg-config").arg("--list-all").output() {
eprintln!("[pkg-config]");
for line in str::from_utf8(&output.stdout).unwrap_or_default().split('\n') {
if line.to_ascii_lowercase().contains("tss") {
eprintln!("{}", line);
}
}
for line in str::from_utf8(&output.stderr).unwrap_or_default().split('\n') {
if line.to_ascii_lowercase().contains("tss") {
eprintln!("{}", line);
}
}
eprintln!();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment