This repository has been archived by the owner on Sep 30, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
π Allow comments in JSON when packaging
- Loading branch information
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
diff --git a/python/mozbuild/mozpack/packager/__init__.py b/python/mozbuild/mozpack/packager/__init__.py | ||
index 6873758eeecbc7e5564a7c882e70894c2b92f9f2..79d66339f47e3dd26b731ea218c6fb402c1745d2 100644 | ||
--- a/python/mozbuild/mozpack/packager/__init__.py | ||
+++ b/python/mozbuild/mozpack/packager/__init__.py | ||
@@ -285,6 +285,16 @@ class SimplePackager(object): | ||
self._add_addon(mozpath.dirname(path), addon) | ||
elif mozpath.basename(path) == "manifest.json": | ||
manifest = six.ensure_text(file.open().read()) | ||
+ | ||
+ # Strip comments from theme addons provided by Pulse | ||
+ # Browser but do not do that for all the other addons | ||
+ # (because it breaks some of them) | ||
+ # | ||
+ # This does not apply to extensions inlueded by gluon | ||
+ # in /browser/extensions | ||
+ if "pulse" in path: | ||
+ manifest = re.sub('//.*?\n', '\n', manifest) | ||
+ | ||
try: | ||
parsed = json.loads(manifest) | ||
except ValueError: |