Skip to content

Commit

Permalink
Fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj committed Nov 20, 2023
1 parent 2fe32c2 commit 2c2db80
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions crates/core/src/tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -681,16 +681,19 @@ impl Tool {
}
_ => {
let checksum_hash = hash_file_contents(download_file)?;
let checksum_matching_line =
format!("{} {}", checksum_hash, fs::file_name(download_file));
let download_file_name = fs::file_name(download_file);

for line in BufReader::new(fs::open_file(checksum_file)?)
.lines()
.flatten()
{
// <checksum> <file>
// <checksum> *<file>
// <checksum>
if line == checksum_matching_line || line == checksum_hash {
if line == checksum_hash
|| (line.starts_with(&checksum_hash)
&& line.ends_with(&download_file_name))
{
verified = true;
break;
}
Expand Down

0 comments on commit 2c2db80

Please sign in to comment.