trying fix macos download

This commit is contained in:
Julian Freeman
2025-12-08 13:19:27 -04:00
parent fd28d4764a
commit 14b0e96c7d
2 changed files with 44 additions and 0 deletions

View File

@@ -95,6 +95,17 @@ pub async fn download_ytdlp(app: &AppHandle) -> Result<PathBuf> {
fs::set_permissions(&path, perms)?;
}
#[cfg(target_os = "macos")]
{
// Remove quarantine attribute to allow execution on macOS
std::process::Command::new("xattr")
.arg("-d")
.arg("com.apple.quarantine")
.arg(&path)
.output()
.ok();
}
Ok(path)
}
@@ -241,6 +252,17 @@ pub async fn download_qjs(app: &AppHandle) -> Result<PathBuf> {
fs::set_permissions(&final_path, perms)?;
}
#[cfg(target_os = "macos")]
{
// Remove quarantine attribute to allow execution on macOS
std::process::Command::new("xattr")
.arg("-d")
.arg("com.apple.quarantine")
.arg(&final_path)
.output()
.ok();
}
Ok(final_path)
}
@@ -262,11 +284,31 @@ pub async fn ensure_binaries(app: &AppHandle) -> Result<()> {
let ytdlp = get_ytdlp_path(app)?;
if !ytdlp.exists() {
download_ytdlp(app).await?;
} else {
#[cfg(target_os = "macos")]
{
std::process::Command::new("xattr")
.arg("-d")
.arg("com.apple.quarantine")
.arg(&ytdlp)
.output()
.ok();
}
}
let qjs = get_qjs_path(app)?;
if !qjs.exists() {
download_qjs(app).await?;
} else {
#[cfg(target_os = "macos")]
{
std::process::Command::new("xattr")
.arg("-d")
.arg("com.apple.quarantine")
.arg(&qjs)
.output()
.ok();
}
}
Ok(())