MCPcopy Create free account
hub / github.com/electric-sql/electric / resolveVersionCode

Function resolveVersionCode

packages/agents-mobile/app.config.ts:174–189  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

172// is evaluated on the GitHub runner or on the EAS Build server (the file
173// is part of the project tarball uploaded to EAS).
174function resolveVersionCode(): number {
175 const fromEnv = process.env.ELECTRIC_AGENTS_MOBILE_VERSION_CODE
176 if (fromEnv) {
177 const parsed = Number.parseInt(fromEnv, 10)
178 if (Number.isFinite(parsed) && parsed > 0) return parsed
179 }
180 try {
181 const info = require(`./.build-info.json`) as { versionCode?: number }
182 if (typeof info.versionCode === `number` && info.versionCode > 0) {
183 return info.versionCode
184 }
185 } catch {
186 // No build-info file — fall through to dev fallback.
187 }
188 return Math.floor(Date.now() / 1000)
189}

Callers 1

app.config.tsFile · 0.85

Calls 1

parseIntMethod · 0.80

Tested by

no test coverage detected