diff --git a/gulpfile.js b/gulpfile.js index 2effe275e..c42c15699 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -15,6 +15,7 @@ const esbuild = require('esbuild'); const pipeline = promisify(require('stream').pipeline); const packageJson = JSON.parse(fs.readFileSync('./package.json', { encoding: 'utf-8' })); + const config = { buildVersion: Date.now().toString(), publish: !!process.env.PUBLISH, @@ -247,7 +248,12 @@ function createVersionFile(done) { // Get Git Commit Hash const gitCommitHash = execSync('git rev-parse --short HEAD', { encoding: 'utf-8' }).trim(); - const data = `export const VERSION = '${formattedDate} (${gitCommitHash})';\n`; + const packageLockJson = JSON.parse(fs.readFileSync('./package-lock.json', { encoding: 'utf-8' })); + const fpaVersion = packageLockJson['packages']['node_modules/@fparchive/flashpoint-archive']['version']; + + const data = `export const VERSION = '${formattedDate} (${gitCommitHash})'; +export const FPA_VERSION = '${fpaVersion}'; +`; // Write to src/shared/version.ts fs.writeFile('src/shared/version.ts', data, (err) => { diff --git a/src/back/index.ts b/src/back/index.ts index b2053e98f..7774037a8 100644 --- a/src/back/index.ts +++ b/src/back/index.ts @@ -14,7 +14,7 @@ import { LangFileContent, getDefaultLocalization } from '@shared/lang'; import { PreferencesFile } from '@shared/preferences/PreferencesFile'; import { defaultPreferencesData } from '@shared/preferences/util'; import { validateSemiUUID } from '@shared/utils/uuid'; -import { VERSION } from '@shared/version'; +import { FPA_VERSION, VERSION } from '@shared/version'; import * as child_process from 'child_process'; import { EventEmitter } from 'events'; import * as flashpoint from 'flashpoint-launcher'; @@ -303,6 +303,7 @@ async function prepForInit(message: any): Promise { }; log.info('Launcher', `Build Version: ${VERSION}`); + log.info('Launcher', `FPA Version: ${FPA_VERSION}`); state.socketServer.secret = content.secret;