Function tauri::api::path::parse

source · []
pub fn parse<P: AsRef<Path>>(
    config: &Config,
    package_info: &PackageInfo,
    env: &Env,
    path: P
) -> Result<PathBuf>
Expand description

Parse the given path, resolving a BaseDirectory variable if the path starts with one.

Examples

use tauri::Manager;
tauri::Builder::default()
  .setup(|app| {
    let path = tauri::api::path::parse(&app.config(), app.package_info(), &app.env(), "$HOME/.bashrc")?;
    assert_eq!(path.to_str().unwrap(), "/home/${whoami}/.bashrc");
    Ok(())
  });