From f0787e710673c4803a3ac405c62715b962277f6b Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Sat, 17 Feb 2018 16:31:45 +0300 Subject: [PATCH] boards.txt.py: fix trailing comma in generated JSON --- package/package_esp8266com_index.template.json | 2 +- tools/boards.txt.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package/package_esp8266com_index.template.json b/package/package_esp8266com_index.template.json index 65b6f32388..177a866b20 100644 --- a/package/package_esp8266com_index.template.json +++ b/package/package_esp8266com_index.template.json @@ -91,7 +91,7 @@ }, { "name": "Digistump Oak" - }, + } ], "toolsDependencies": [ { diff --git a/tools/boards.txt.py b/tools/boards.txt.py index 5d0a1db279..066ccf52b6 100755 --- a/tools/boards.txt.py +++ b/tools/boards.txt.py @@ -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)