2017-12-23 21:45:34 -05:00
|
|
|
import * as git from "git-rev-sync";
|
|
|
|
|
|
|
|
let version = "Unknown";
|
2018-03-30 18:34:39 -04:00
|
|
|
let gitHash = null;
|
2017-12-23 21:45:34 -05:00
|
|
|
|
|
|
|
try {
|
|
|
|
version = "v" + require("../../package.json").version;
|
|
|
|
} catch (error) {
|
2018-03-30 18:34:39 -04:00
|
|
|
// The log service isn't set up by the time we require this file
|
|
|
|
console.error("version", error);
|
2017-12-23 21:45:34 -05:00
|
|
|
}
|
|
|
|
|
2018-03-30 18:34:39 -04:00
|
|
|
try {
|
|
|
|
gitHash = git.short();
|
|
|
|
} 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 : "");
|