firefox addon fix

This commit is contained in:
2021-11-06 13:40:06 +01:00
parent 1e7b9b3d8d
commit 052c0d1e78
5 changed files with 21 additions and 6 deletions

View File

@ -3,6 +3,7 @@
import argparse
import json
import sys
import urllib.request
from pathlib import Path
import re
import shutil
@ -114,6 +115,19 @@ def copy_built():
elif file.suffix != '.ts':
shutil.copy(str(file), str(build_file))
ext_path = Path('build', 'ext')
if not ext_path.is_dir():
ext_path.mkdir()
for name, url in {
'hls.js': 'https://cdn.jsdelivr.net/npm/hls.js@latest',
'popper.js': 'https://unpkg.com/@popperjs/core@2',
'tippy.js': 'https://unpkg.com/tippy.js@6'
}.items():
with open(ext_path.joinpath(name), 'wb') as f:
ext_js = urllib.request.urlopen(url)
f.write(ext_js.read())
f.close()
def clean_build():
for file in Path('src').rglob('*'):