Skip to content
This repository was archived by the owner on Jan 10, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### `0.4.2`
- #134 Wrap file creation in try/catch

### `0.4.1`
- #133 Write down to file when using the formatter

Expand Down
11 changes: 6 additions & 5 deletions lib/codecov/formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ def format(report)
}
result.update(result_to_codecov(report))

result_path = File.join(::SimpleCov.coverage_path, RESULT_FILE_NAME)
if File.writable?(result_path)
begin
result_path = File.join(::SimpleCov.coverage_path, RESULT_FILE_NAME)
File.write(result_path, result['codecov'])
puts "Coverage report generated to #{result_path}.\#{result}"
else
puts "Could not write coverage report to file #{result_path}.\n#{result}"
puts "Coverage report generated to #{result_path}.\n#{result}"
rescue Errno::ENOENT => e
puts e
puts "Could not write coverage report to file.\n#{result}"
end

result
Expand Down
2 changes: 1 addition & 1 deletion lib/codecov/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Codecov
VERSION = '0.4.1'
VERSION = '0.4.2'
end