diff --git a/hes-editor/src-tauri/src/main.rs b/hes-editor/src-tauri/src/main.rs index 9e7ece53..ceef07fb 100644 --- a/hes-editor/src-tauri/src/main.rs +++ b/hes-editor/src-tauri/src/main.rs @@ -4,32 +4,8 @@ windows_subsystem = "windows" )] -use std::{fs, io::prelude::*, path::PathBuf}; - -#[tauri::command] -async fn read_file(path: PathBuf) -> Result { - match fs::read_to_string(path) { - Ok(contents) => Ok(contents), - Err(err) => Err(err.to_string()), - } -} - -#[tauri::command] -async fn write_file( - path: PathBuf, - content: String, -) -> Result<(), String> { - match fs::write(path, content) { - Ok(_) => Ok(()), - Err(err) => Err(err.to_string()), - } -} - fn main() { tauri::Builder::default() - .invoke_handler(tauri::generate_handler![ - read_file, write_file, - ]) .run(tauri::generate_context!()) .expect("error while running tauri application"); } diff --git a/hes-game/src-tauri/src/main.rs b/hes-game/src-tauri/src/main.rs index 523550d3..ceef07fb 100644 --- a/hes-game/src-tauri/src/main.rs +++ b/hes-game/src-tauri/src/main.rs @@ -1,15 +1,11 @@ // Prevents additional console window on Windows in release, DO NOT REMOVE!! -#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] - -// Learn more about Tauri commands at https://tauri.app/v1/guides/features/command -#[tauri::command] -fn greet(name: &str) -> String { - format!("Hello, {}! You've been greeted from Rust!", name) -} +#![cfg_attr( + not(debug_assertions), + windows_subsystem = "windows" +)] fn main() { tauri::Builder::default() - .invoke_handler(tauri::generate_handler![greet]) .run(tauri::generate_context!()) .expect("error while running tauri application"); } diff --git a/hes-game/src-tauri/tauri.conf.json b/hes-game/src-tauri/tauri.conf.json index 87615db9..53eae081 100644 --- a/hes-game/src-tauri/tauri.conf.json +++ b/hes-game/src-tauri/tauri.conf.json @@ -1,9 +1,9 @@ { "build": { - "beforeDevCommand": "cargo leptos watch", - "beforeBuildCommand": "cargo leptos build --release", - "devPath": "http://localhost:3000", - "distDir": "../target/site/pkg", + "beforeDevCommand": "trunk serve", + "beforeBuildCommand": "trunk build --release", + "devPath": "http://localhost:1420", + "distDir": "../dist", "withGlobalTauri": true }, "package": {