mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
download_strategy: fix brew style, refactor.
This commit is contained in:
parent
12a0c281ea
commit
dca43851af
@ -66,13 +66,13 @@ class AbstractDownloadStrategy
|
||||
|
||||
def chdir
|
||||
entries = Dir["*"]
|
||||
case entries.length
|
||||
when 0 then raise "Empty archive"
|
||||
when 1 then begin
|
||||
Dir.chdir entries.first
|
||||
rescue
|
||||
nil
|
||||
end
|
||||
raise "Empty archive" if entries.length.zero?
|
||||
return if entries.length != 1
|
||||
|
||||
begin
|
||||
Dir.chdir entries.first
|
||||
rescue
|
||||
nil
|
||||
end
|
||||
end
|
||||
private :chdir
|
||||
|
Loading…
x
Reference in New Issue
Block a user