Refactor app version handling in appupdate.js and rpc.js
All checks were successful
farmcontrol/farmcontrol-ui/pipeline/head This commit looks good
All checks were successful
farmcontrol/farmcontrol-ui/pipeline/head This commit looks good
- Updated `getRunningAppVersion` to retrieve the version from `package.json`, ensuring accurate version representation. - Modified `getAppVersion` in `rpc.js` to utilize the refactored `getRunningAppVersion`, improving consistency in version reporting.
This commit is contained in:
parent
578caaffc2
commit
f52f0e35a9
@ -10,6 +10,7 @@ import { launchWindowsInstaller } from './winappupdate.js'
|
|||||||
import { checkForDuplicateInstallations } from './check-duplicate-installations.js'
|
import { checkForDuplicateInstallations } from './check-duplicate-installations.js'
|
||||||
import { scheduleAppRestart } from './updater-runner.js'
|
import { scheduleAppRestart } from './updater-runner.js'
|
||||||
import buildInfo from '../buildInfo.json'
|
import buildInfo from '../buildInfo.json'
|
||||||
|
import { version as packageVersion } from '../../package.json'
|
||||||
import { getAppSettings, setAppSettings } from './store.js'
|
import { getAppSettings, setAppSettings } from './store.js'
|
||||||
|
|
||||||
const SUPPORTED_TARGETS = {
|
const SUPPORTED_TARGETS = {
|
||||||
@ -232,11 +233,8 @@ const formatFullAppVersion = (version, buildNumber) => {
|
|||||||
return `v${normalizedVersion}-${buildSuffix}`
|
return `v${normalizedVersion}-${buildSuffix}`
|
||||||
}
|
}
|
||||||
|
|
||||||
const getRunningAppVersion = () =>
|
export const getRunningAppVersion = () =>
|
||||||
formatFullAppVersion(
|
formatFullAppVersion(packageVersion, buildInfo?.buildNumber)
|
||||||
process.env.ELECTROBUN_VERSION,
|
|
||||||
buildInfo?.buildNumber
|
|
||||||
)
|
|
||||||
|
|
||||||
const getRunningAppState = (mainWindow, settings) => ({
|
const getRunningAppState = (mainWindow, settings) => ({
|
||||||
version: getRunningAppVersion(),
|
version: getRunningAppVersion(),
|
||||||
|
|||||||
@ -1,5 +1,9 @@
|
|||||||
import { BrowserView } from 'electrobun/bun'
|
import { BrowserView } from 'electrobun/bun'
|
||||||
import { checkForCompletedUpdate, startAppUpdate } from './appupdate.js'
|
import {
|
||||||
|
checkForCompletedUpdate,
|
||||||
|
getRunningAppVersion,
|
||||||
|
startAppUpdate
|
||||||
|
} from './appupdate.js'
|
||||||
import {
|
import {
|
||||||
checkForDuplicateInstallations,
|
checkForDuplicateInstallations,
|
||||||
removeDuplicateInstallations
|
removeDuplicateInstallations
|
||||||
@ -89,7 +93,7 @@ export function createAppRpc() {
|
|||||||
})
|
})
|
||||||
return { ok: true }
|
return { ok: true }
|
||||||
},
|
},
|
||||||
getAppVersion: async () => process.env.ELECTROBUN_VERSION || 'desktop',
|
getAppVersion: async () => getRunningAppVersion() || 'desktop',
|
||||||
getAppEngine: async () => {
|
getAppEngine: async () => {
|
||||||
const mainWindow = getMainWindow()
|
const mainWindow = getMainWindow()
|
||||||
const renderer = mainWindow?.renderer || 'native'
|
const renderer = mainWindow?.renderer || 'native'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user