mirror of
https://github.com/wassname/talk.git
synced 2026-07-31 12:50:48 +08:00
* 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
17 lines
600 B
TypeScript
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")));
|
|
}
|