resource: fix incorrect argument error for empty/non-existent target

This commit is contained in:
Bo Anderson 2020-05-31 20:35:48 +01:00
parent a829fef52e
commit 2ba0bc809e

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)