JS and its ecosystem is absolute garbage
This commit is contained in:
parent
f1c1486417
commit
e5d96243d4
20 changed files with 2796 additions and 2982 deletions
25
crates/librqbit/webui/post-build
Executable file
25
crates/librqbit/webui/post-build
Executable file
|
|
@ -0,0 +1,25 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import json
|
||||
|
||||
os.chdir('dist')
|
||||
|
||||
with open('manifest.json', 'r') as f:
|
||||
manifest = json.load(f)
|
||||
|
||||
for replacements in manifest.values():
|
||||
js_file = replacements['file']
|
||||
target_file = replacements['src']
|
||||
|
||||
with open(target_file, 'r') as f:
|
||||
target_content = f.read()
|
||||
|
||||
target_content = target_content.replace("/" + js_file, 'app.js')
|
||||
with open(target_file, 'w') as f:
|
||||
f.write(target_content)
|
||||
|
||||
os.rename(js_file, 'app.js')
|
||||
|
||||
os.rmdir('assets')
|
||||
os.remove('manifest.json')
|
||||
Loading…
Add table
Add a link
Reference in a new issue