Skip to content

Commit f0787e7

Browse files
committed
boards.txt.py: fix trailing comma in generated JSON
1 parent aa37364 commit f0787e7

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

package/package_esp8266com_index.template.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
},
9292
{
9393
"name": "Digistump Oak"
94-
},
94+
}
9595
],
9696
"toolsDependencies": [
9797
{

tools/boards.txt.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -1182,9 +1182,10 @@ def package ():
11821182
filestr = package_file.read()
11831183

11841184
substitution = '"boards": [\n'
1185-
for id in boards:
1186-
substitution += ' {\n "name": "' + boards[id]['name'] + '"\n },\n'
1187-
substitution += ' ],'
1185+
board_items = [' {\n "name": "%s"\n }' % boards[id]['name']
1186+
for id in boards]
1187+
substitution += ',\n'.join(board_items)
1188+
substitution += '\n ],'
11881189

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

0 commit comments

Comments
 (0)