use crate::{Version, VersionReq};
use std::path::{Path, PathBuf};
use std::sync::LazyLock;
use tokio::runtime::Runtime;
static RUNTIME: LazyLock<Runtime> = LazyLock::new(|| Runtime::new().unwrap());
pub fn get_version(url: &str, version_req: &VersionReq) -> crate::Result<Version> {
RUNTIME
.handle()
.block_on(async move { crate::get_version(url, version_req).await })
}
pub fn get_archive(url: &str, version_req: &VersionReq) -> crate::Result<(Version, Vec<u8>)> {
RUNTIME
.handle()
.block_on(async move { crate::get_archive(url, version_req).await })
}
pub fn extract(url: &str, bytes: &Vec<u8>, out_dir: &Path) -> crate::Result<Vec<PathBuf>> {
RUNTIME
.handle()
.block_on(async move { crate::extract(url, bytes, out_dir).await })
}