Skip to content

Commit

Permalink
Update build.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathnerd314 committed Sep 15, 2017
1 parent 2a7cd8e commit 5531ad6
Showing 1 changed file with 4 additions and 27 deletions.
31 changes: 4 additions & 27 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,11 @@
from zipfile import ZipFile, ZIP_STORED, ZIP_DEFLATED

resources = [
"install.rdf",
"chrome.manifest",
"*.xul",
"locale/*/*.dtd",
"locale/*/*.properties",
"defaults/preferences/prefs.js",
"icon.png", "icon64.png",
"manifest.json",
"_locales/*/messages.json",
"icon.png", "icon32.png", "icon64.png",
"LICENSE.txt",
"content-script.js"
"*.js", "options.html"
]
destination = "repagination.xpi"

Expand All @@ -34,26 +30,7 @@ def Minor():
yield


def get_js_requires(scripts):
known = set()
scripts = list(scripts)
for script in scripts:
with open(script) as sp:
for line in sp:
m = re.search(r"(?:r|lazyR)equire\((['\"])(.+?)\1", line)
if not m:
continue
m = m.group(2) + ".js"
if m in known:
continue
known.add(m)
scripts += m,
return set(scripts)


def get_files(resources):
for r in get_js_requires(("bootstrap.js", "loader.jsm")):
yield r
for r in resources:
if os.path.isfile(r):
yield r
Expand Down

0 comments on commit 5531ad6

Please sign in to comment.