Flatten a conditional

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
This commit is contained in:
Clinton Wolfe 2019-11-27 11:54:40 -05:00
parent bba6d70b3b
commit b6cb418af6

View file

@ -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