mirror of
https://github.com/inspec/inspec
synced 2024-12-12 06:12:37 +00:00
Flatten a conditional
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
This commit is contained in:
parent
bba6d70b3b
commit
b6cb418af6
1 changed files with 2 additions and 6 deletions
|
@ -102,12 +102,8 @@ module Inspec::Fetcher
|
||||||
|
|
||||||
def perform_shasum(target)
|
def perform_shasum(target)
|
||||||
return @archive_shasum if @archive_shasum
|
return @archive_shasum if @archive_shasum
|
||||||
|
raise(Inspec::FetcherFailure, "Profile dependency local path '#{target}' does not exist") unless File.exist?(target)
|
||||||
if File.exist?(target)
|
|
||||||
@archive_shasum = OpenSSL::Digest::SHA256.digest(File.read(target)).unpack("H*")[0]
|
@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
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def resolved_source
|
def resolved_source
|
||||||
|
|
Loading…
Reference in a new issue