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,15 +66,15 @@ class AbstractDownloadStrategy
|
|||||||
|
|
||||||
def chdir
|
def chdir
|
||||||
entries = Dir["*"]
|
entries = Dir["*"]
|
||||||
case entries.length
|
raise "Empty archive" if entries.length.zero?
|
||||||
when 0 then raise "Empty archive"
|
return if entries.length != 1
|
||||||
when 1 then begin
|
|
||||||
|
begin
|
||||||
Dir.chdir entries.first
|
Dir.chdir entries.first
|
||||||
rescue
|
rescue
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
private :chdir
|
private :chdir
|
||||||
|
|
||||||
# @!attribute [r] source_modified_time
|
# @!attribute [r] source_modified_time
|
||||||
|
Loading…
x
Reference in New Issue
Block a user