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Ae,WAAW,EAAE,CAAC,CAAC;AACpE,CAAC;AAZD,wCAYC","sourcesContent":["import { ExpoConfig } from '../Config.types';\n\nconst DEFAULT_VERSION_NAME = '1.0';\nconst DEFAULT_VERSION_CODE = '1';\n\nexport function getVersionName(config: ExpoConfig) {\n return config.version ? config.version : null;\n}\n\nexport function setVersionName(\n config: ExpoConfig,\n buildGradle: string,\n versionToReplace = DEFAULT_VERSION_NAME\n) {\n let versionName = getVersionName(config);\n if (versionName === null) {\n return buildGradle;\n }\n\n let pattern = new RegExp(`versionName \"${versionToReplace}\"`);\n return buildGradle.replace(pattern, `versionName \"${versionName}\"`);\n}\n\nexport function getVersionCode(config: ExpoConfig) {\n return config.android && config.android.versionCode ? config.android.versionCode : null;\n}\n\nexport function setVersionCode(\n config: ExpoConfig,\n buildGradle: string,\n versionCodeToReplace = DEFAULT_VERSION_CODE\n) {\n let versionCode = getVersionCode(config);\n if (versionCode === null) {\n return buildGradle;\n }\n\n let pattern = new RegExp(`versionCode ${versionCodeToReplace}`);\n return buildGradle.replace(pattern, `versionCode ${versionCode}`);\n}\n"]}
\No newline at end of file