fix: resolve compilation errors and warnings in keep crate
Co-authored-by: aider (openai/andrew.openrouter.qwen.qwen3-coder) <aider@aider.chat>
This commit is contained in:
@@ -36,6 +36,24 @@ impl CompressionEngineProgram {
|
||||
}
|
||||
}
|
||||
|
||||
fn get_program_path(program: &str) -> Result<String> {
|
||||
debug!("COMPRESSION: Looking for executable: {}", program);
|
||||
if let Ok(path) = env::var("PATH") {
|
||||
for p in path.split(':') {
|
||||
let p_str = format!("{}/{}", p, program);
|
||||
let stat = fs::metadata(p_str.clone());
|
||||
if let Ok(stat) = stat {
|
||||
let md = stat;
|
||||
let permissions = md.permissions();
|
||||
if md.is_file() && permissions.mode() & 0o111 != 0 {
|
||||
return Ok(p_str);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Err(anyhow!("Unable to find binary {} in PATH", program))
|
||||
}
|
||||
|
||||
impl CompressionEngine for CompressionEngineProgram {
|
||||
fn is_supported(&self) -> bool {
|
||||
self.supported
|
||||
|
||||
Reference in New Issue
Block a user