mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-28 03:00:23 -07:00
blockinfile will always add newline at EOF (#2261)
This commit is contained in:
parent
fae2a50d4d
commit
393ea3293c
1 changed files with 3 additions and 1 deletions
|
@ -280,7 +280,9 @@ def main():
|
||||||
lines[n0:n0] = blocklines
|
lines[n0:n0] = blocklines
|
||||||
|
|
||||||
if lines:
|
if lines:
|
||||||
result = '\n'.join(lines)+'\n'
|
result = '\n'.join(lines)
|
||||||
|
if original.endswith('\n'):
|
||||||
|
result += '\n'
|
||||||
else:
|
else:
|
||||||
result = ''
|
result = ''
|
||||||
if original == result:
|
if original == result:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue