Compare commits

...

2 Commits

Author SHA1 Message Date
e9f4c1f3d3 Refine CEF installer artifact detection logic in app update process
All checks were successful
farmcontrol/farmcontrol-ui/pipeline/head This commit looks good
- Updated isCefInstallerArtifact function to use a regex pattern for identifying CEF installer artifacts, improving accuracy in artifact name matching.
- Enhanced comments for clarity on CEF build naming conventions, aiding future maintenance and understanding of the code.
2026-08-08 21:56:32 +01:00
1d741d8932 Add artifact filtering for CEF installer in app update process
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.
2026-08-08 21:10:12 +01:00

View File

@ -25,6 +25,12 @@ let runningUpdate = null
const getArtifactName = (artifact) =>
String(artifact?.fileName || artifact?.relativePath || artifact?.url || '')
const isCefInstallerArtifact = (artifact) => {
const name = getArtifactName(artifact).toLowerCase()
// CEF builds are named like farmcontrol-0.1.1-x64-cef.msi / -cef.pkg / -cef.exe
return /-cef\.[a-z0-9]+$/.test(name)
}
const normalizeArch = (arch) => {
if (arch === 'x64' || arch === 'amd64') return 'x64'
if (arch === 'arm64' || arch === 'aarch64') return 'arm64'
@ -69,7 +75,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)
)