You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
754 B
30 lines
754 B
import { existsSync } from 'fs';
|
|
import path from 'path';
|
|
import logger from '../logger';
|
|
|
|
const COMMIT_TAG_PATH = path.join(__dirname, '../../committag.json');
|
|
let commitTag = 'local';
|
|
|
|
if (existsSync(COMMIT_TAG_PATH)) {
|
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
commitTag = require(COMMIT_TAG_PATH).commitTag;
|
|
logger.info(`Commit Tag: ${commitTag}`);
|
|
}
|
|
|
|
export const getCommitTag = (): string => {
|
|
return commitTag;
|
|
};
|
|
|
|
export const getAppVersion = (): string => {
|
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
const { version } = require('../../package.json');
|
|
|
|
let finalVersion = version;
|
|
|
|
if (version === '0.1.0') {
|
|
finalVersion = `develop-${getCommitTag()}`;
|
|
}
|
|
|
|
return finalVersion;
|
|
};
|