mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Validate arguments in Resource#stage
This commit is contained in:
parent
a3000f3ea9
commit
0ed43d607b
@ -72,8 +72,11 @@ class Resource
|
||||
downloader.clear_cache
|
||||
end
|
||||
|
||||
# Fetch, verify, and unpack the resource
|
||||
def stage(target=nil, &block)
|
||||
unless target || block
|
||||
raise ArgumentError, "target directory or block is required"
|
||||
end
|
||||
|
||||
verify_download_integrity(fetch)
|
||||
unpack(target, &block)
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user