add-links/add_front_end_libraries.py

23 lines
443 B
Python
Raw Normal View History

2023-10-04 12:56:21 +01:00
#!/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")