Set execute permissions on ALL files in sidecar dir on Unix
All checks were successful
Release / Bump version and tag (push) Successful in 3s
Release / Build App (macOS) (push) Successful in 1m43s
Release / Build App (Windows) (push) Successful in 3m20s
Release / Build App (Linux) (push) Successful in 3m36s

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:
Claude
2026-03-23 13:30:24 -07:00
parent 2bfb1b276e
commit 32bfbd3791
3 changed files with 24 additions and 21 deletions

View File

@@ -99,16 +99,6 @@ fn find_ffmpeg() -> Option<String> {
}; };
let ffmpeg_path = sidecar_dir.join(ffmpeg_name); let ffmpeg_path = sidecar_dir.join(ffmpeg_name);
if ffmpeg_path.exists() { if ffmpeg_path.exists() {
// Ensure execute permission on Unix
#[cfg(unix)]
{
use std::os::unix::fs::PermissionsExt;
if let Ok(meta) = std::fs::metadata(&ffmpeg_path) {
let mut perms = meta.permissions();
perms.set_mode(0o755);
let _ = std::fs::set_permissions(&ffmpeg_path, perms);
}
}
return Some(ffmpeg_path.to_string_lossy().to_string()); return Some(ffmpeg_path.to_string_lossy().to_string());
} }
} }

View File

@@ -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)); let extract_dir = data_dir.join(format!("sidecar-{}", sidecar_version));
SidecarManager::extract_zip(&zip_path, &extract_dir)?; 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)] #[cfg(unix)]
{ {
use std::os::unix::fs::PermissionsExt; use std::os::unix::fs::PermissionsExt;
let binary_path = extract_dir.join("voice-to-notes-sidecar"); if let Ok(entries) = std::fs::read_dir(&extract_dir) {
if let Ok(meta) = std::fs::metadata(&binary_path) { for entry in entries.flatten() {
let mut perms = meta.permissions(); let path = entry.path();
perms.set_mode(0o755); if path.is_file() {
let _ = std::fs::set_permissions(&binary_path, perms); if let Ok(meta) = std::fs::metadata(&path) {
let mut perms = meta.permissions();
perms.set_mode(0o755);
let _ = std::fs::set_permissions(&path, perms);
}
}
}
} }
} }

View File

@@ -113,14 +113,21 @@ impl SidecarManager {
)); ));
} }
// Make executable on Unix // Make all binaries executable on Unix (sidecar, ffmpeg, ffprobe, etc.)
#[cfg(unix)] #[cfg(unix)]
{ {
use std::os::unix::fs::PermissionsExt; use std::os::unix::fs::PermissionsExt;
if let Ok(meta) = std::fs::metadata(&binary_path) { if let Ok(entries) = std::fs::read_dir(&extract_dir) {
let mut perms = meta.permissions(); for entry in entries.flatten() {
perms.set_mode(0o755); let path = entry.path();
let _ = std::fs::set_permissions(&binary_path, perms); 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);
}
}
}
} }
} }