Update used crates

This commit is contained in:
UTAKERDEV 2025-05-08 20:51:58 +02:00
parent eff3bccf2b
commit 7c53183bb3
3 changed files with 81 additions and 744 deletions

810
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -5,5 +5,5 @@ edition = "2024"
[dependencies] [dependencies]
eframe = "0.31.1" eframe = "0.31.1"
git2 = "0.20.1" git2 = "0.20.2"
reqwest = {version = "0.12.15", features = ["blocking", "rustls-tls"] } ureq = "3.0.11"

View file

@ -1,15 +1,18 @@
// Import std crate // Import std crate
use std::io::Read;
use std::process::Command; use std::process::Command;
use std::fs; use std::fs;
use std::path::Path; use std::path::Path;
// Funtion for Downloading and installing rust automatically // Function for downloading and installing Rust automatically
pub fn download_install_rust() -> Result<(), Box<dyn std::error::Error>> { pub fn download_install_rust() -> Result<(), Box<dyn std::error::Error>> {
let url = "https://win.rustup.rs/x86_64"; let url = "https://win.rustup.rs/x86_64";
let exe_name = "rustup-init.exe"; let exe_name = "rustup-init.exe";
let response = reqwest::blocking::get(url)?; let mut response = ureq::get(url).call()?;
let bytes = response.bytes()?; let mut reader = response.body_mut().as_reader();
let mut bytes = Vec::new();
reader.read_to_end(&mut bytes)?;
fs::write(exe_name, &bytes)?; fs::write(exe_name, &bytes)?;
println!("[✓] Download finished: {}", exe_name); println!("[✓] Download finished: {}", exe_name);
@ -25,7 +28,6 @@ pub fn download_install_rust() -> Result<(), Box<dyn std::error::Error>> {
return Ok(()); return Ok(());
} }
// Downloading and Install Windows MSVC for building the PS
let status_stable = Command::new("rustup") let status_stable = Command::new("rustup")
.args(["install", "stable-x86_64-pc-windows-msvc"]) .args(["install", "stable-x86_64-pc-windows-msvc"])
.status()?; .status()?;
@ -36,7 +38,6 @@ pub fn download_install_rust() -> Result<(), Box<dyn std::error::Error>> {
eprintln!("[✗] Failed to install stable MSVC toolchain."); eprintln!("[✗] Failed to install stable MSVC toolchain.");
} }
// Cleaning
if Path::new(exe_name).exists() { if Path::new(exe_name).exists() {
fs::remove_file(exe_name)?; fs::remove_file(exe_name)?;
println!("[✓] Cleanup finished."); println!("[✓] Cleanup finished.");