Skip to content

Commit

Permalink
boards.txt.py: fix trailing comma in generated JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
igrr committed Feb 19, 2018
1 parent aa37364 commit f0787e7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package/package_esp8266com_index.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
},
{
"name": "Digistump Oak"
},
}
],
"toolsDependencies": [
{
Expand Down
7 changes: 4 additions & 3 deletions tools/boards.txt.py
Original file line number Diff line number Diff line change
Expand Up @@ -1182,9 +1182,10 @@ def package ():
filestr = package_file.read()

substitution = '"boards": [\n'
for id in boards:
substitution += ' {\n "name": "' + boards[id]['name'] + '"\n },\n'
substitution += ' ],'
board_items = [' {\n "name": "%s"\n }' % boards[id]['name']
for id in boards]
substitution += ',\n'.join(board_items)
substitution += '\n ],'

newfilestr = re.sub(r'"boards":[^\]]*\],', substitution, filestr, re.MULTILINE)

Expand Down

0 comments on commit f0787e7

Please sign in to comment.