From 7406881eeb898087da63788fcbf191cc5a0f16c3 Mon Sep 17 00:00:00 2001 From: Jeffrey Morgan Date: Fri, 7 Jul 2023 11:41:53 -0400 Subject: [PATCH] write version at build time --- app/forge.config.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/forge.config.ts b/app/forge.config.ts index 420ecff0..5ec52284 100644 --- a/app/forge.config.ts +++ b/app/forge.config.ts @@ -1,4 +1,4 @@ -import type { ForgeConfig } from '@electron-forge/shared-types' +import type { ForgeConfig, ResolvedForgeConfig, ForgeMakeResult } from '@electron-forge/shared-types' import { MakerSquirrel } from '@electron-forge/maker-squirrel' import { MakerZIP } from '@electron-forge/maker-zip' import { PublisherGithub } from '@electron-forge/publisher-github' @@ -49,6 +49,11 @@ const config: ForgeConfig = { prerelease: true, }), ], + hooks: { + readPackageJson: async (_, packageJson) => { + return { ...packageJson, version: process.env.VERSION || packageJson.version } + }, + }, plugins: [ new AutoUnpackNativesPlugin({}), new WebpackPlugin({