Open arielnmz opened 6 years ago
Since I don't want to fork I suggest the following patch as a fix:
Index: bumpversion/__init__.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- bumpversion/__init__.py (date 1435260711000)
+++ bumpversion/__init__.py (date 1522533107000)
@@ -860,7 +860,7 @@
if write_to_config_file:
with io.open(config_file, 'wb') as f:
- f.write(new_config.getvalue().encode('utf-8'))
+ f.write((new_config.getvalue().strip()+'\n').encode('utf-8'))
except UnicodeEncodeError:
warnings.warn(
It just strips and appends a single newline at the end of the file, perhaps a better solution would be checking at the _write_section
method of the RawConfigParser
class, but this does the trick.
See this fork https://github.com/c4urself/bump2version/
Whenever you bump the .bumpversion.cfg file ends up with 2 newlines at the end