forked from Archive/PX4-Autopilot
Merge pull request #3078 from yuanxing-THU/master
Ignore .DS_Store in the ROMFS pruner.
This commit is contained in:
commit
8ba0c003db
|
@ -57,7 +57,7 @@ def main():
|
|||
for (root, dirs, files) in os.walk(args.folder):
|
||||
for file in 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
|
||||
|
||||
file_path = os.path.join(root, file)
|
||||
|
@ -74,8 +74,7 @@ def main():
|
|||
else:
|
||||
if not line.isspace() and not line.strip().startswith("#"):
|
||||
pruned_content += line
|
||||
|
||||
# overwrite old scratch file
|
||||
# overwrite old scratch file
|
||||
with open(file_path, "wb") as f:
|
||||
f.write(pruned_content.encode("ascii", errors='strict'))
|
||||
|
||||
|
|
Loading…
Reference in New Issue