mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-01 02:55:07 +08:00
Merge pull request #3078 from yuanxing-THU/master
Ignore .DS_Store in the ROMFS pruner.
This commit is contained in:
@@ -57,7 +57,7 @@ def main():
|
|||||||
for (root, dirs, files) in os.walk(args.folder):
|
for (root, dirs, files) in os.walk(args.folder):
|
||||||
for file in files:
|
for file in files:
|
||||||
# only prune text files
|
# only prune text files
|
||||||
if ".zip" in file or ".bin" in file or ".swp" in file or ".data" in file:
|
if ".zip" in file or ".bin" in file or ".swp" in file or ".data" in file or ".DS_Store" in file:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
file_path = os.path.join(root, file)
|
file_path = os.path.join(root, file)
|
||||||
@@ -74,7 +74,6 @@ def main():
|
|||||||
else:
|
else:
|
||||||
if not line.isspace() and not line.strip().startswith("#"):
|
if not line.isspace() and not line.strip().startswith("#"):
|
||||||
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:
|
||||||
f.write(pruned_content.encode("ascii", errors='strict'))
|
f.write(pruned_content.encode("ascii", errors='strict'))
|
||||||
|
|||||||
Reference in New Issue
Block a user