INNER CODE UNIT · Rust

resolve_bundled_python

shenmintao/marginalia · desktop/src-tauri/src/lib.rs:74

fn resolve_bundled_python(app: &AppHandle) -> Option<(PathBuf, PathBuf)> {
    let resource_dir = app.path().resource_dir().ok()?;
    let backend_dir = resource_dir.join("resources").join("backend");
    let manifest_path = backend_dir.join("runtime-manifest.json");
    let manifest_bytes = std::fs::read(&manifest_path)
        .map_err(|e| {
            log::error!(
                "missing runtime-manifest.json at {}: {}",
                manifest_path.display(),
                e
            )
        })
        .ok()?;
    let manifest: RuntimeManifest = serde_json::from_slice(&manifest_bytes)
        .map_err(|e| log::error!("invalid runtime-manifest.json: {}", e))
        .ok()?;
    let python = backend_dir.join(&manifest.python);
    if !python.is_file() {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…