Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Commit e6684cd

Browse files
committed
🐛 Allow comments in JSON when packaging
1 parent c07491b commit e6684cd

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
diff --git a/python/mozbuild/mozpack/packager/__init__.py b/python/mozbuild/mozpack/packager/__init__.py
2+
index 6873758eeecbc7e5564a7c882e70894c2b92f9f2..79d66339f47e3dd26b731ea218c6fb402c1745d2 100644
3+
--- a/python/mozbuild/mozpack/packager/__init__.py
4+
+++ b/python/mozbuild/mozpack/packager/__init__.py
5+
@@ -285,6 +285,16 @@ class SimplePackager(object):
6+
self._add_addon(mozpath.dirname(path), addon)
7+
elif mozpath.basename(path) == "manifest.json":
8+
manifest = six.ensure_text(file.open().read())
9+
+
10+
+ # Strip comments from theme addons provided by Pulse
11+
+ # Browser but do not do that for all the other addons
12+
+ # (because it breaks some of them)
13+
+ #
14+
+ # This does not apply to extensions inlueded by gluon
15+
+ # in /browser/extensions
16+
+ if "pulse" in path:
17+
+ manifest = re.sub('//.*?\n', '\n', manifest)
18+
+
19+
try:
20+
parsed = json.loads(manifest)
21+
except ValueError:

0 commit comments

Comments
 (0)