Files
talk/src/core/common/version.ts
T
Wyatt JohnsonandGitHub cda72ba249 [next] Docker + Revision Metadata (#1991)
* feat: added version metadata, release to Docker

* fix: fixed mistake with export

* fix: adjusted circle cache beheviour

* fix: removed node_modules from workspace

* fix: added version prefix to cache keys

* review: patched invalid job name

* fix: hardcode cache version prefix :(

* fix: improved cache keys
2018-10-12 19:13:55 +00:00

17 lines
600 B
TypeScript

import fs from "fs";
import path from "path";
export let revision: string = "";
export let version: string = "";
// Pull the version information from the package.json file.
const packagePath = path.join(__dirname, "..", "..", "..", "package.json");
({ version } = JSON.parse(fs.readFileSync(packagePath, "utf8")));
// Try to get the revision from the revision file. This file is generated by the
// Docker build.
const revisionPath = path.join(__dirname, "__generated__", "revision.json");
if (fs.existsSync(revisionPath)) {
({ revision } = JSON.parse(fs.readFileSync(revisionPath, "utf8")));
}