Set execute permissions on ALL files in sidecar dir on Unix
Previously only the main sidecar binary got chmod 755. Now all files in the extraction directory get execute permissions — covers ffmpeg, ffprobe, and any other bundled binaries. Applied in three places: - sidecar/mod.rs: after local extraction - commands/sidecar.rs: after download extraction - commands/media.rs: removed single-file fix (now handled globally) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -197,15 +197,21 @@ pub async fn download_sidecar(app: AppHandle, variant: String) -> Result<(), Str
|
||||
let extract_dir = data_dir.join(format!("sidecar-{}", sidecar_version));
|
||||
SidecarManager::extract_zip(&zip_path, &extract_dir)?;
|
||||
|
||||
// Make the binary executable on Unix
|
||||
// Make all binaries executable on Unix (sidecar, ffmpeg, ffprobe, etc.)
|
||||
#[cfg(unix)]
|
||||
{
|
||||
use std::os::unix::fs::PermissionsExt;
|
||||
let binary_path = extract_dir.join("voice-to-notes-sidecar");
|
||||
if let Ok(meta) = std::fs::metadata(&binary_path) {
|
||||
let mut perms = meta.permissions();
|
||||
perms.set_mode(0o755);
|
||||
let _ = std::fs::set_permissions(&binary_path, perms);
|
||||
if let Ok(entries) = std::fs::read_dir(&extract_dir) {
|
||||
for entry in entries.flatten() {
|
||||
let path = entry.path();
|
||||
if path.is_file() {
|
||||
if let Ok(meta) = std::fs::metadata(&path) {
|
||||
let mut perms = meta.permissions();
|
||||
perms.set_mode(0o755);
|
||||
let _ = std::fs::set_permissions(&path, perms);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user