diff options
| author | Jack Nagel | 2014-10-10 20:30:29 -0500 | 
|---|---|---|
| committer | Jack Nagel | 2014-10-10 20:30:29 -0500 | 
| commit | f8c1116599ac69be6308796cdabdc620dd72f1d0 (patch) | |
| tree | 067951372ad36e698ab67cb61ea94c4abf64a4cb | |
| parent | 901ad7e4d82fac261a73cdcfc104cc1a96cd5421 (diff) | |
| download | homebrew-f8c1116599ac69be6308796cdabdc620dd72f1d0.tar.bz2 | |
Pull cache creation out of begin block
| -rw-r--r-- | Library/Homebrew/resource.rb | 12 | 
1 files changed, 7 insertions, 5 deletions
| diff --git a/Library/Homebrew/resource.rb b/Library/Homebrew/resource.rb index 0866fa622..f3bd46106 100644 --- a/Library/Homebrew/resource.rb +++ b/Library/Homebrew/resource.rb @@ -78,12 +78,14 @@ class Resource    end    def fetch -    # Ensure the cache exists      HOMEBREW_CACHE.mkpath -    downloader.fetch -  rescue ErrorDuringExecution, CurlDownloadStrategyError => e -    raise DownloadError.new(self, e) -  else + +    begin +      downloader.fetch +    rescue ErrorDuringExecution, CurlDownloadStrategyError => e +      raise DownloadError.new(self, e) +    end +      cached_download    end | 
