mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
blockinfile: Add a newline at EOF when the file is newly created (#3174)
Ref: #2687
This commit is contained in:
parent
9ca2fef23a
commit
8bb9149a10
1 changed files with 1 additions and 1 deletions
|
@ -285,7 +285,7 @@ def main():
|
|||
|
||||
if lines:
|
||||
result = '\n'.join(lines)
|
||||
if original and original.endswith('\n'):
|
||||
if original is None or original.endswith('\n'):
|
||||
result += '\n'
|
||||
else:
|
||||
result = ''
|
||||
|
|
Loading…
Reference in a new issue