fix
This commit is contained in:
parent
d0669bdc5e
commit
edc5f84b6d
4 changed files with 27 additions and 10 deletions
9
cmd/telesrv-admin/web/dist/assets/index-CUyr22ox.js
vendored
Normal file
9
cmd/telesrv-admin/web/dist/assets/index-CUyr22ox.js
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
cmd/telesrv-admin/web/dist/index.html
vendored
2
cmd/telesrv-admin/web/dist/index.html
vendored
|
|
@ -23,7 +23,7 @@
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script type="module" crossorigin src="/assets/index-LWf3JhYx.js"></script>
|
<script type="module" crossorigin src="/assets/index-CUyr22ox.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-CQKJMNpu.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-CQKJMNpu.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
|
||||||
|
|
@ -275,6 +275,23 @@ class ServerManager:
|
||||||
def build(self) -> tuple[bool, str]:
|
def build(self) -> tuple[bool, str]:
|
||||||
BIN_DIR.mkdir(exist_ok=True)
|
BIN_DIR.mkdir(exist_ok=True)
|
||||||
log = []
|
log = []
|
||||||
|
# cmd/telesrv-admin embeds web/dist via go:embed -- `go build` alone
|
||||||
|
# just re-embeds whatever dist/ already happens to be on disk, so a
|
||||||
|
# frontend-only change (edit TSX, restart) silently ships the old
|
||||||
|
# bundle unless we rebuild it here first, every time.
|
||||||
|
admin_web_dir = ROOT / "cmd" / "telesrv-admin" / "web"
|
||||||
|
if (admin_web_dir / "package.json").exists():
|
||||||
|
npm = shutil.which("npm")
|
||||||
|
if npm:
|
||||||
|
r = subprocess.run(
|
||||||
|
[npm, "run", "build"],
|
||||||
|
cwd=admin_web_dir, capture_output=True, text=True,
|
||||||
|
)
|
||||||
|
log.append(f"$ npm run build (admin web)\n{r.stdout}{r.stderr}")
|
||||||
|
if r.returncode != 0:
|
||||||
|
return False, "\n".join(log)
|
||||||
|
else:
|
||||||
|
log.append("! npm not found on PATH -- skipping admin web frontend rebuild (go:embed will reuse the existing web/dist)")
|
||||||
for out_path, pkg in ((SERVER_EXE, "./cmd/telesrv"), (ADMIN_EXE, "./cmd/telesrv-admin")):
|
for out_path, pkg in ((SERVER_EXE, "./cmd/telesrv"), (ADMIN_EXE, "./cmd/telesrv-admin")):
|
||||||
r = subprocess.run(
|
r = subprocess.run(
|
||||||
["go", "build", "-o", str(out_path), pkg],
|
["go", "build", "-o", str(out_path), pkg],
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue