trying fix macos download
This commit is contained in:
@@ -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(())
|
||||
|
||||
Reference in New Issue
Block a user