mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-20 11:06:06 +00:00
0c2226c5f0
The gateway imported hostVersion from the plugin install code to put the version in its welcome frame, which made the realtime domain, imported by nearly every other, depend on plugins. The running version (image VERSION or APP_VERSION, else package.json) is app config; runningVersion() holds it and the plugin host-compat checks call the same function.
12 lines
472 B
TypeScript
12 lines
472 B
TypeScript
import { readEnv } from './env';
|
|
|
|
/**
|
|
* The running TREK version: the image's VERSION file or APP_VERSION (both behind
|
|
* `readEnv().app.appVersion`), else server/package.json. The websocket welcome
|
|
* frame and the plugin host-compatibility checks both announce it, so it lives
|
|
* here rather than inside either domain.
|
|
*/
|
|
export function runningVersion(): string {
|
|
return readEnv().app.appVersion || (require('../../package.json') as { version: string }).version;
|
|
}
|