mirror of
https://github.com/github/codeql-action.git
synced 2025-12-26 17:20:10 +08:00
This commit only adds a single package and all of its transitive dependencies. The github-linguist package will be used for counting lines of code as a baseline for databases we are analyzing.
26 lines
555 B
TypeScript
26 lines
555 B
TypeScript
import fs from 'fs';
|
|
import path from 'path';
|
|
// @ts-ignore
|
|
import slash from 'slash2';
|
|
|
|
const packagePath = slash(path.join(__dirname, '../', 'package.json'));
|
|
|
|
/**
|
|
* Get package version.
|
|
*
|
|
* @export getVersion
|
|
* @returns {string}
|
|
*/
|
|
export function getVersion(): string {
|
|
const packageInfo = JSON.parse(fs.readFileSync(packagePath, 'utf8'));
|
|
|
|
return (packageInfo && packageInfo.version) || 'invalid version!';
|
|
}
|
|
|
|
export const ExtensionJustify = {
|
|
'.ts': 'typescript',
|
|
'.jsx': 'javascript',
|
|
'.js': 'javascript',
|
|
'.tsx': 'typescript',
|
|
};
|