Merge pull request #7669 from Bo98/resource-argument-fix

resource: fix incorrect argument error for empty/non-existent target
This commit is contained in:
Mike McQuaid 2020-06-01 08:54:29 +01:00 committed by GitHub
commit 1e76ecdfdd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -72,7 +72,7 @@ class Resource
# directory. Subclasses that override stage should implement the tmp
# dir using {Mktemp} so that works with all subtypes.
def stage(target = nil, &block)
raise ArgumentError, "target directory or block is required" if target.blank? && block.blank?
raise ArgumentError, "target directory or block is required" if !target && block.blank?
prepare_patches
fetch_patches(skip_downloaded: true)