matrix-dimension/src/version.ts

23 lines
593 B
TypeScript
Raw Normal View History

import * as child_process from 'child_process';
let version = "Unknown";
let gitHash = null;
try {
version = "v" + require("../package.json").version;
} catch (error) {
// The log service isn't set up by the time we require this file
console.error("version", error);
}
try {
gitHash = child_process
2021-09-01 23:01:01 +00:00
.execSync('git rev-parse --short HEAD')
.toString().trim()
} catch (error) {
// The log service isn't set up by the time we require this file
console.error("version", error);
}
export const CURRENT_VERSION = version + (gitHash ? "-" + gitHash : "");