mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-14 08:04:52 +01:00
Fix certificate issue & rustc warning
This commit is contained in:
@@ -176,7 +176,6 @@ pub fn generate_ca_files(path: &str) {
|
|||||||
Ok(_) => {},
|
Ok(_) => {},
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
println!("{}", e);
|
println!("{}", e);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -203,7 +202,7 @@ pub fn generate_ca_files(path: &str) {
|
|||||||
*/
|
*/
|
||||||
pub fn install_ca_files(path: &str) {
|
pub fn install_ca_files(path: &str) {
|
||||||
if cfg!(target_os = "windows") {
|
if cfg!(target_os = "windows") {
|
||||||
run_command(format!("certutil -addstore -f \"ROOT\" {}\\ca\\certificate.crt", path).to_string());
|
run_command(format!("certutil -addstore -f \"ROOT\" {}\\ca\\cert.crt", path).to_string());
|
||||||
} else {
|
} else {
|
||||||
run_command(format!("sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain {}/ca/certificate.crt", path).to_string());
|
run_command(format!("sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain {}/ca/certificate.crt", path).to_string());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ pub fn run_program(path: String) {
|
|||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
pub fn run_command(command: String) {
|
pub fn run_command(command: String) {
|
||||||
// Run the specified command.
|
// Run the specified command.
|
||||||
let output = if cfg!(target_os = "windows") {
|
if cfg!(target_os = "windows") {
|
||||||
Command::new("cmd")
|
Command::new("cmd")
|
||||||
.args(["/C", command.as_str()])
|
.args(["/C", command.as_str()])
|
||||||
.output()
|
.output()
|
||||||
|
|||||||
Reference in New Issue
Block a user