Add artifact filtering for CEF installer in app update process
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
- Introduced isCefInstallerArtifact function to identify CEF installer artifacts based on their file names. - Updated artifact selection logic to filter out CEF installer artifacts, ensuring only relevant updates are processed. - Enhanced overall update handling by improving artifact management and reducing unnecessary processing.
This commit is contained in:
parent
00f55d44bf
commit
1d741d8932
@ -25,6 +25,11 @@ let runningUpdate = null
|
||||
const getArtifactName = (artifact) =>
|
||||
String(artifact?.fileName || artifact?.relativePath || artifact?.url || '')
|
||||
|
||||
const isCefInstallerArtifact = (artifact) => {
|
||||
const name = getArtifactName(artifact).toLowerCase()
|
||||
return name.endsWith('-cef.exe') || name.endsWith('-cef.pkg')
|
||||
}
|
||||
|
||||
const normalizeArch = (arch) => {
|
||||
if (arch === 'x64' || arch === 'amd64') return 'x64'
|
||||
if (arch === 'arm64' || arch === 'aarch64') return 'arm64'
|
||||
@ -69,7 +74,9 @@ const selectUpdateArtifact = (
|
||||
throw new Error(`App updates are not supported on ${platform}.`)
|
||||
}
|
||||
|
||||
const artifacts = Array.isArray(update?.artifacts) ? update.artifacts : []
|
||||
const artifacts = (Array.isArray(update?.artifacts) ? update.artifacts : []).filter(
|
||||
(artifact) => !isCefInstallerArtifact(artifact)
|
||||
)
|
||||
const matchingArtifact = artifacts.find((artifact) =>
|
||||
artifactMatchesPlatform(artifact, target, platform, arch)
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user