use std::path::Path; pub async fn make_executable>(_path: P) -> anyhow::Result<()> { #[cfg(unix)] { use anyhow::Context; use fs_err::tokio as fs; use std::os::unix::fs::PermissionsExt; let mut perms = fs::metadata(&_path) .await .context("failed to get bin link file metadata")? .permissions(); perms.set_mode(perms.mode() | 0o111); fs::set_permissions(&_path, perms) .await .context("failed to set bin link file permissions")?; } Ok(()) }