Skip to content
Snippets Groups Projects
Commit e22a7229 authored by Nik | Klampfradler's avatar Nik | Klampfradler Committed by magicfelix
Browse files

Fix return code of vite build management command

parent 3da607a6
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,15 @@ All notable changes to this project will be documented in this file.
The format is based on `Keep a Changelog`_,
and this project adheres to `Semantic Versioning`_.
Unreleased
----------
Fixed
~~~~~
* [Docker] The build could silently continue even if frontend bundling failed, resulting
in an incomplete AlekSIS frontend app.
`3.1.2`_ - 2023-07-05
---------------------
......
import os
from django.conf import settings
from django.core.management.base import CommandError
from django_yarnpkg.management.base import BaseYarnCommand
from django_yarnpkg.yarn import yarn_adapter
......@@ -26,4 +27,6 @@ class Command(BaseYarnCommand):
yarn_adapter.install(settings.YARN_INSTALLED_APPS)
# Run Vite build
run_vite([options["command"]])
ret = run_vite([options["command"]])
if ret != 0:
raise CommandError("yarn command failed", returncode=ret)
......@@ -49,7 +49,7 @@ def write_vite_values(out_path: str) -> dict[str, Any]:
json.dump(vite_values, out)
def run_vite(args: Optional[Sequence[str]] = None) -> None:
def run_vite(args: Optional[Sequence[str]] = None) -> int:
args = list(args) if args else []
config_path = os.path.join(settings.BASE_DIR, "aleksis", "core", "vite.config.js")
......@@ -64,7 +64,7 @@ def run_vite(args: Optional[Sequence[str]] = None) -> None:
log_level = {"INFO": "info", "WARNING": "warn", "ERROR": "error"}.get(log_level, "silent")
args += ["-l", log_level]
yarn_adapter.call_yarn(["run", "vite"] + args)
return yarn_adapter.call_yarn(["run", "vite"] + args)
def get_language_cookie(code: str) -> str:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment