mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-13 07:34:36 +01:00
Merge main
This commit is contained in:
@@ -5,7 +5,6 @@ windows_subsystem = "windows"
|
|||||||
|
|
||||||
use once_cell::sync::Lazy;
|
use once_cell::sync::Lazy;
|
||||||
use std::{sync::Mutex, collections::HashMap};
|
use std::{sync::Mutex, collections::HashMap};
|
||||||
use std::path::PathBuf;
|
|
||||||
|
|
||||||
use std::thread;
|
use std::thread;
|
||||||
use sysinfo::{System, SystemExt};
|
use sysinfo::{System, SystemExt};
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
use duct::cmd;
|
use duct::cmd;
|
||||||
|
|
||||||
use crate::file_helpers;
|
|
||||||
|
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
pub fn run_program(path: String) {
|
pub fn run_program(path: String) {
|
||||||
// Open the program from the specified path.
|
// Open in new thread to prevent blocking.
|
||||||
open::that(&path).unwrap();
|
std::thread::spawn(move || {
|
||||||
|
open::that(&path).unwrap();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export async function toggleEncryption(path: string) {
|
|||||||
// Write file
|
// Write file
|
||||||
await fs.writeFile({
|
await fs.writeFile({
|
||||||
path,
|
path,
|
||||||
contents: JSON.stringify(serverConf)
|
contents: JSON.stringify(serverConf, null, 2),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user