diff --git a/dev-scripts/src/update_docs.rs b/dev-scripts/src/update_docs.rs index bb02dccb..da71780a 100644 --- a/dev-scripts/src/update_docs.rs +++ b/dev-scripts/src/update_docs.rs @@ -26,7 +26,7 @@ fn download_artifact(artifact_list: &Vec, h: HashMap, nam let mut tmp_zip_file = OpenOptions::new().create(true).write(true).open(format!("./tmp/{file}.zip"))?; tmp_zip_file.write_all(&*download.bytes)?; let reader = BufReader::new(File::open(format!("./tmp/{file}.zip"))?); - let mut zip = zip::ZipArchive::new(reader).expect("zip read failed"); + let mut zip = zip::ZipArchive::new(reader).or_else(|_| Err("Could not open zip file"))?; let mut file_zip = zip.by_index(0).unwrap(); println!("Extracting {}", file_zip.name()); let mut writer = BufWriter::new( @@ -46,7 +46,7 @@ pub fn update_docs(gh_token: &str) -> weather_error::Result<()> { let mut headers = HashMap::new(); headers.insert("Authorization".to_string(), format!("Bearer {}", gh_token)); let get_run_id = networking::get_url("https://api.github.com/repos/arihant2math/weathercli/actions/runs?per_page=10&status=completed", - None, Some(headers.clone()), None)?; + None, Some(headers.clone()), None)?; let runs_json: Value = serde_json::from_str(&get_run_id.text)?; let runs = runs_json["workflow_runs"].as_array() .ok_or("not an array")?; @@ -57,7 +57,7 @@ pub fn update_docs(gh_token: &str) -> weather_error::Result<()> { let tasks = vec![ ["weather (Windows)", "weather.exe"], ["weather (Linux)", "weather"]]; - tasks.par_iter().for_each(|&s| download_artifact(&rust_artifacts, headers.clone(), s[0], s[1]).unwrap()); + tasks.par_iter().for_each(|&s| { download_artifact(&rust_artifacts, headers.clone(), s[0], s[1]); }); fs::remove_dir_all(working_dir.join("tmp"))?; // TODO: Implement index version updates update_hash("./docs_templates/weather.exe", "weather-exe-hash-windows")?; update_hash("./docs_templates/weather", "weather-exe-hash-unix")?; diff --git a/docs_templates/index.json b/docs_templates/index.json index 33fee683..641f6325 100644 --- a/docs_templates/index.json +++ b/docs_templates/index.json @@ -5,7 +5,7 @@ "weather-ascii-images-hash": "88d3a14ff38704ac6de6f5a3a70034d0953fdea42da8e236fb322af59715d0c5", "weather-codes-hash": "bfcf6956375369febb0de68d1c2a7e6a2a74e7cfa750c7b16b7e09b57b1af97c", "weather-exe-hash-unix": "e597bfd269eeb9e995637d83851dc1516b989d599c72fcd30abff35adebcfe87", - "weather-exe-hash-windows": "8a9bf1616e9252cfbf09e838f82a316a2663dd574de04600edece7f94137a661", + "weather-exe-hash-windows": "6d472ac6b4a3ef91547a248607d29a10fb8bb495b0b60cc128fd713f838d2df7", "weatherd-exe-hash-unix": "e395838c92be917e42d6c3136ea2053901ec6e32a73a80411382ee7c64258065", "weatherd-exe-hash-windows": "3b1c4e3dd3522aa58626766da2ae96c002fcaa1c3331ae9091d883afa8702a0d" } \ No newline at end of file diff --git a/docs_templates/weather.exe b/docs_templates/weather.exe index 275cabcf..218b8aa4 100644 Binary files a/docs_templates/weather.exe and b/docs_templates/weather.exe differ