23 lines
443 B
Python
23 lines
443 B
Python
|
#!/usr/bin/python3
|
||
|
|
||
|
import os
|
||
|
import shutil
|
||
|
import subprocess
|
||
|
|
||
|
STATIC_DIR = "static"
|
||
|
|
||
|
assert os.path.exists("package.json") and os.path.exists("node_modules")
|
||
|
|
||
|
if not os.path.exists(STATIC_DIR):
|
||
|
os.mkdir(STATIC_DIR)
|
||
|
|
||
|
shutil.copytree(
|
||
|
"node_modules/bootstrap/dist/",
|
||
|
os.path.join(STATIC_DIR, "bootstrap"),
|
||
|
dirs_exist_ok=True,
|
||
|
)
|
||
|
|
||
|
subprocess.run(["npm", "run", "build"], check=True)
|
||
|
|
||
|
shutil.copy("dist/add_links.es.js", "static")
|