Merge pull request #1 from sdhEmily/corruption_check
bootstrapper update corruption check
This commit is contained in:
commit
ea35090634
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "syntax_bootstrapper"
|
||||
version = "1.2.0"
|
||||
version = "1.2.1"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
|
|
|||
14
src/main.rs
14
src/main.rs
|
|
@ -247,9 +247,19 @@ async fn main() {
|
|||
// Run the latest bootstrapper ( with the same arguments passed to us ) and exit
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
let mut command = std::process::Command::new(latest_bootstrapper_path);
|
||||
let mut command = std::process::Command::new(latest_bootstrapper_path.clone());
|
||||
command.args(&args[1..]);
|
||||
command.spawn().unwrap();
|
||||
match command.spawn() {
|
||||
Ok(_) => {},
|
||||
Err(e) => {
|
||||
debug(&format!("Bootstrapper errored with error {}", e));
|
||||
info("Found bootstrapper was corrupted! Downloading...");
|
||||
std::fs::remove_file(latest_bootstrapper_path.clone()).unwrap();
|
||||
download_file(&http_client, &format!("https://{}/{}-{}", setup_url, latest_client_version, bootstrapper_filename), &latest_bootstrapper_path).await;
|
||||
command.spawn().expect("Bootstrapper is still corrupted.");
|
||||
std::thread::sleep(std::time::Duration::from_secs(20));
|
||||
}
|
||||
}
|
||||
}
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue