Refactoring Collections, and getting docker ready.

This commit is contained in:
th3r00t
2023-11-27 15:21:23 -05:00
parent 1e2998aed6
commit 44a376f172
10 changed files with 63 additions and 61 deletions

View File

@@ -1,6 +1,4 @@
"""pyShelf's Frontend Objects."""
from sys import exit
from shutil import which
from subprocess import run
from pathlib import Path
from ...backend.lib.config import Config
@@ -16,16 +14,5 @@ class JSInterface():
def install(self):
"""Install the JavaScript dependencies."""
if which("npm"):
self.config.logger.info("Installing JavaScript dependencies...")
run(["npm", "install"], cwd=self.package_json.parent)
else:
self.config.logger.error("npm is not installed.")
exit(1)
if which("npx"):
self.config.logger.info("Compiling TypeScript...")
run(["npx", "tsc", "static/script/pyshelf.ts"], cwd=self.package_json.parent)
else:
self.config.logger.error("npx is not installed.")
exit(1)
run(["npm", "install"], cwd=self.package_json.parent)
run(["npx", "tsc", "static/script/pyshelf.ts"], cwd=self.package_json.parent)