Skip to content

Commit

Permalink
api: avoid unnecessary file write operation
Browse files Browse the repository at this point in the history
  • Loading branch information
Bo98 committed Feb 16, 2023
1 parent d7d775a commit 5fe477d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Library/Homebrew/api.rb
Expand Up @@ -82,7 +82,7 @@ def self.fetch_json_api_file(endpoint, target:)
opoo "#{target.basename}: update failed, falling back to cached version."
end

FileUtils.touch target
File.touch(target) unless skip_download
JSON.parse(target.read)
rescue JSON::ParserError
target.unlink
Expand Down

0 comments on commit 5fe477d

Please sign in to comment.