use std::path::PathBuf; use tauri_plugin_fs::FsExt; #[tauri::command] fn allow_project_directory(app: tauri::AppHandle, path: String) -> Result<(), String> { app.fs_scope() .allow_directory(PathBuf::from(path), true) .map_err(|error| error.to_string()) } fn main() { tauri::Builder::default() .plugin(tauri_plugin_dialog::init()) .plugin(tauri_plugin_fs::init()) .invoke_handler(tauri::generate_handler![allow_project_directory]) .run(tauri::generate_context!()) .expect("error while running BlockFlow Workbench"); }