mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-01 02:55:07 +08:00
Merge pull request #3124 from PX4/mixer_files
use correct Unix line ending character
This commit is contained in:
@@ -40,7 +40,7 @@ Delete all comments and newlines before ROMFS is converted to an image
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
import argparse
|
import argparse, re
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ def main():
|
|||||||
|
|
||||||
# read file line by line
|
# read file line by line
|
||||||
pruned_content = ""
|
pruned_content = ""
|
||||||
with open(file_path, "r") as f:
|
with open(file_path, "rU") as f:
|
||||||
for line in f:
|
for line in f:
|
||||||
|
|
||||||
# handle mixer files differently than startup files
|
# handle mixer files differently than startup files
|
||||||
@@ -76,6 +76,7 @@ def main():
|
|||||||
pruned_content += line
|
pruned_content += line
|
||||||
# overwrite old scratch file
|
# overwrite old scratch file
|
||||||
with open(file_path, "wb") as f:
|
with open(file_path, "wb") as f:
|
||||||
|
pruned_content = re.sub("\r\n", "\n", pruned_content)
|
||||||
f.write(pruned_content.encode("ascii", errors='strict'))
|
f.write(pruned_content.encode("ascii", errors='strict'))
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user