Skip to content

Commit

Permalink
Merge pull request #28 from Xyntexx/skip_existing
Browse files Browse the repository at this point in the history
#27 Fix symbol added outside library structure when file ends in a new line
  • Loading branch information
TousstNicolas committed Dec 10, 2022
2 parents 3920e1f + b95e014 commit e815ded
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion JLC2KiCadLib/schematic/schematic.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,9 @@ def update_library(library_name, component_title, template_lib_component, output
lib_file.write(sub.encode())
else:
# move before the library footer and write the component template
lib_file.seek(-len(template_lib_footer), 2)
# find the last occurence of the footer
last_footer_index = file_content.rfind(")")
lib_file.seek(last_footer_index)
lib_file.truncate()
lib_file.write(template_lib_component.encode())
lib_file.write(template_lib_footer.encode())

0 comments on commit e815ded

Please sign in to comment.