Implement file renaming

This commit is contained in:
Pascal Le Merrer 2026-01-19 14:13:52 +01:00
parent 18d8003f4a
commit e583d4e4cb
11 changed files with 291 additions and 18 deletions

View file

@ -1,16 +1,19 @@
// Learn more about Tauri commands at https://tauri.app/develop/calling-rust/
#[tauri::command]
fn get_home_directory() {
println!("I was invoked from JavaScript!");
#[tauri::command(rename_all = "snake_case")]
fn rename(invoke_message: String) {
// TODO: use a structure with old_name and new_name
println!(
"I was invoked from JavaScript, with this message: {}",
invoke_message
);
}
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
tauri::Builder::default()
.invoke_handler(tauri::generate_handler![get_home_directory])
.plugin(tauri_plugin_os::init())
.invoke_handler(tauri::generate_handler![rename])
.plugin(tauri_plugin_fs::init())
.run(tauri::generate_context!())
.expect("error while running tauri application");