use version instead of commit hash

This commit is contained in:
Mylloon 2022-10-28 20:10:53 +02:00
parent 42086bfa47
commit b6823521fb
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
2 changed files with 3 additions and 3 deletions

View file

@ -33,7 +33,7 @@ def init() -> None:
"""Initialise everything before running the flask server"""
# Download dependencies
init_font("1.3.0")
init_libjs("fc5e3c53e41490e24ca7f67cb24e7ab389b770f9")
init_libjs("3.1.2")
# Create upload folder if doesn't exists
if not exist(Config.uploads_dir):

View file

@ -5,7 +5,7 @@ from requests import get
from utils.misc import exist
def init(commit_hash: str) -> None:
def init(version: str) -> None:
""" Download JS libraries"""
path = "./src/public/js/libs"
filename = "bigint-mod.js"
@ -19,7 +19,7 @@ def init(commit_hash: str) -> None:
# Download the js file if needed
if not exist(f"{path}/{filename}"):
# Download the font file
file_url = f"https://raw.githubusercontent.com/juanelas/bigint-mod-arith/{commit_hash}/dist/esm/index.browser.js"
file_url = f"https://raw.githubusercontent.com/juanelas/bigint-mod-arith/v{version}/dist/esm/index.browser.js"
data = get(file_url).content
# Save the file