Merge pull request #14666 from Bo98/no-api-write

api: avoid unnecessary file write operation
This commit is contained in:
Mike McQuaid 2023-02-16 16:59:36 +00:00 committed by GitHub
commit b38aca8a6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -82,7 +82,7 @@ module Homebrew
opoo "#{target.basename}: update failed, falling back to cached version."
end
FileUtils.touch target
FileUtils.touch(target) unless skip_download
JSON.parse(target.read)
rescue JSON::ParserError
target.unlink