File tree Expand file tree Collapse file tree
lib/fastlane/plugin/wpmreleasetoolkit/actions/common Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,16 +8,18 @@ def self.run(params)
88 release_notes_file_path = params [ :release_notes_file_path ]
99 extracted_notes_file_path = params [ :extracted_notes_file_path ]
1010
11- extracted_notes_file = File . open ( extracted_notes_file_path , 'w' ) unless extracted_notes_file_path . blank?
12-
11+ extracted_notes = ''
1312 extract_notes ( release_notes_file_path , version ) do |line |
14- extracted_notes_file . nil? ? puts ( line ) : extracted_notes_file . write ( line )
13+ extracted_notes += line
1514 end
15+ extracted_notes . chomp! ( '' ) # Remove any extra empty line(s) at the end
1616
17- return if extracted_notes_file . nil?
17+ unless extracted_notes_file_path . nil? || extracted_notes_file_path . empty?
18+ File . write ( extracted_notes_file_path , extracted_notes )
19+ commit_extracted_notes_file ( extracted_notes_file_path , version )
20+ end
1821
19- extracted_notes_file . close
20- commit_extracted_notes_file ( extracted_notes_file_path , version )
22+ extracted_notes
2123 end
2224
2325 def self . extract_notes ( release_notes_file_path , version )
@@ -57,7 +59,7 @@ def self.authors
5759 end
5860
5961 def self . return_value
60- # If your method provides a return value, you can describe here what it does
62+ 'The content of the extracted release notes (the same text as what was written in the `extracted_notes_file_path` if one was provided)'
6163 end
6264
6365 def self . details
You can’t perform that action at this time.
0 commit comments