Prevent amalgamate.py from adding trailing whitespace

When adding the license text, only add leading whitespace to non-empty
lines, otherwise it becomes trailing whitespace.
This commit is contained in:
Jonathan Wakely 2024-10-24 10:47:17 +01:00
parent 9ab35254a8
commit a60ef3b2e1

View File

@ -27,7 +27,10 @@ for filename in ['LICENSE-MIT', 'LICENSE-APACHE', 'LICENSE-BOOST']:
text = '' text = ''
for line in lines: for line in lines:
text += '// ' + line.strip() + '\n' line = line.strip()
if len(line):
line = ' ' + line
text += '//' + line + '\n'
processed_files[filename] = text processed_files[filename] = text
# code # code