Merge pull request #14666 from Bo98/no-api-write
api: avoid unnecessary file write operation
This commit is contained in:
commit
b38aca8a6e
@ -82,7 +82,7 @@ module Homebrew
|
|||||||
opoo "#{target.basename}: update failed, falling back to cached version."
|
opoo "#{target.basename}: update failed, falling back to cached version."
|
||||||
end
|
end
|
||||||
|
|
||||||
FileUtils.touch target
|
FileUtils.touch(target) unless skip_download
|
||||||
JSON.parse(target.read)
|
JSON.parse(target.read)
|
||||||
rescue JSON::ParserError
|
rescue JSON::ParserError
|
||||||
target.unlink
|
target.unlink
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user