From dfd94f4f2eaedc054f5f528738b2e362496c46d9 Mon Sep 17 00:00:00 2001 From: syeopite Date: Mon, 19 Feb 2024 15:16:33 -0800 Subject: [PATCH] Improve error message for checksum failure --- scripts/fetch-player-dependencies.cr | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/fetch-player-dependencies.cr b/scripts/fetch-player-dependencies.cr index b10122bf..097d61a7 100755 --- a/scripts/fetch-player-dependencies.cr +++ b/scripts/fetch-player-dependencies.cr @@ -116,8 +116,11 @@ class Dependency end private def validate_checksum(io) - if !CONFIG.skip_checksum && Digest::SHA1.hexdigest(io) != @config.shasum - raise IO::Error.new("Checksum for '#{@dependency}' failed") + return if CONFIG.skip_checksum + + digest = Digest::SHA1.hexdigest(io) + if digest != @config.shasum + raise IO::Error.new("Checksum for '#{@dependency}' failed. \"#{digest}\" does not match configured \"#{@config.shasum}\"") end end