mirror of
https://github.com/hanzoai/dev-desktop.git
synced 2026-11-20 01:07:23 +00:00
19 lines
724 B
JavaScript
19 lines
724 B
JavaScript
// @ts-check
|
|
const fs = require("node:fs");
|
|
const path = require("node:path");
|
|
|
|
// Include the major version, which Expo ignores, to prevent OTAs reaching older store binaries.
|
|
const appConfig = fs.readFileSync(path.join(__dirname, "app.config.ts"), "utf8");
|
|
const version =
|
|
process.env.HANZO_DEV_MOBILE_VERSION ??
|
|
appConfig.match(/^ {2}version: repoEnv\.HANZO_DEV_MOBILE_VERSION \?\? "([^"]+)"/m)?.[1];
|
|
const majorVersion = version?.match(/^(\d+)\./)?.[1];
|
|
if (!majorVersion) {
|
|
throw new Error("fingerprint.config.js could not read the app version from app.config.ts");
|
|
}
|
|
|
|
module.exports = {
|
|
nativeModuleSourceType: "files",
|
|
extraSources: [{ type: "contents", id: "appMajorVersion", contents: majorVersion }],
|
|
};
|