diff --git a/lib/inspec/fetcher/local.rb b/lib/inspec/fetcher/local.rb index 429b98d66..6ffff73d7 100644 --- a/lib/inspec/fetcher/local.rb +++ b/lib/inspec/fetcher/local.rb @@ -102,12 +102,8 @@ module Inspec::Fetcher def perform_shasum(target) return @archive_shasum if @archive_shasum - - if File.exist?(target) - @archive_shasum = OpenSSL::Digest::SHA256.digest(File.read(target)).unpack("H*")[0] - else - raise Inspec::FetcherFailure, "Profile dependency local path '#{target}' does not exist" - end + raise(Inspec::FetcherFailure, "Profile dependency local path '#{target}' does not exist") unless File.exist?(target) + @archive_shasum = OpenSSL::Digest::SHA256.digest(File.read(target)).unpack("H*")[0] end def resolved_source