mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-31 18:44:27 +02:00
Unix line-endings for extensions.json (#4153)
This commit is contained in:
@@ -1,23 +1,23 @@
|
||||
% import json
|
||||
% import os
|
||||
% import re
|
||||
%
|
||||
% recommendations = set(["platformio.platformio-ide"])
|
||||
% previous_json = os.path.join(project_dir, ".vscode", "extensions.json")
|
||||
% if os.path.isfile(previous_json):
|
||||
% fp = open(previous_json)
|
||||
% contents = re.sub(r"^\s*//.*$", "", fp.read(), flags=re.M).strip()
|
||||
% fp.close()
|
||||
% if contents:
|
||||
% recommendations |= set(json.loads(contents).get("recommendations", []))
|
||||
% end
|
||||
% end
|
||||
{
|
||||
// See http://go.microsoft.com/fwlink/?LinkId=827846
|
||||
// for the documentation about the extensions.json format
|
||||
"recommendations": [
|
||||
% for i, item in enumerate(sorted(recommendations)):
|
||||
"{{ item }}"{{ ("," if (i + 1) < len(recommendations) else "") }}
|
||||
% end
|
||||
]
|
||||
}
|
||||
% import json
|
||||
% import os
|
||||
% import re
|
||||
%
|
||||
% recommendations = set(["platformio.platformio-ide"])
|
||||
% previous_json = os.path.join(project_dir, ".vscode", "extensions.json")
|
||||
% if os.path.isfile(previous_json):
|
||||
% fp = open(previous_json)
|
||||
% contents = re.sub(r"^\s*//.*$", "", fp.read(), flags=re.M).strip()
|
||||
% fp.close()
|
||||
% if contents:
|
||||
% recommendations |= set(json.loads(contents).get("recommendations", []))
|
||||
% end
|
||||
% end
|
||||
{
|
||||
// See http://go.microsoft.com/fwlink/?LinkId=827846
|
||||
// for the documentation about the extensions.json format
|
||||
"recommendations": [
|
||||
% for i, item in enumerate(sorted(recommendations)):
|
||||
"{{ item }}"{{ ("," if (i + 1) < len(recommendations) else "") }}
|
||||
% end
|
||||
]
|
||||
}
|
||||
|
Reference in New Issue
Block a user