Skip to content

Commit 9a68c1a

Browse files
committed
fix geode index install
1 parent 5f05796 commit 9a68c1a

File tree

3 files changed

+4
-28
lines changed

3 files changed

+4
-28
lines changed

Cargo.lock

Lines changed: 0 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ semver = "1.0.23"
3838
reqwest = { version = "0.12.5", features = ["json", "blocking"] }
3939
cfg-if = "1.0.0"
4040
regex = "1.10.5"
41-
sha3 = "0.10.8"
4241
hex = "0.4.3"
4342
edit-distance = "2.1.0"
4443
which = "6.0.1"

src/index.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use reqwest::header::USER_AGENT;
77
use semver::VersionReq;
88
use serde::Deserialize;
99
use serde_json::json;
10-
use sha3::{Digest, Sha3_256};
1110
use std::fs;
1211
use std::io::Cursor;
1312
use std::path::PathBuf;
@@ -140,18 +139,16 @@ pub fn install_mod(
140139
.mods_dir()
141140
.join(format!("{id}.geode"));
142141

143-
let mut hasher = Sha3_256::new();
144-
hasher.update(&bytes);
145-
let hash = hex::encode(hasher.finalize());
142+
let hash = sha256::digest(bytes.as_ref());
146143

147-
if hash != found_version.version {
144+
if hash != found_version.hash {
148145
fatal!(
149-
"Downloaded file doesn't match nice_unwraped hash\n\
146+
"Downloaded file doesn't match expected hash\n\
150147
{hash}\n\
151148
vs {}\n\
152149
Try again, and if the issue persists, report this on GitHub: \
153150
https://github.com/geode-sdk/cli/issues/new",
154-
found_version.version
151+
found_version.hash
155152
);
156153
}
157154

0 commit comments

Comments
 (0)