diff --git a/index.js b/index.js index e2dbb66..69dc479 100644 --- a/index.js +++ b/index.js @@ -111,6 +111,15 @@ function isExpoProject(projPath) { } } +/** + * Determine if the given property is managed by an enviromental variable + * @param {String} text + * @return {Boolean} true if the given property is managed by an enviromental variable + */ +function isManagedByEnvVariable(propertyText) { + return propertyText ? !!/\$\(\S+\)/g.exec(propertyText) : false; +} + /** * Versions your app * @param {Object} program commander/CLI-style options, camelCased @@ -431,7 +440,8 @@ function version(program, projectPath) { CFBundleShortVersionString: appPkg.version } : {}, - !programOpts.neverIncrementBuild + !programOpts.neverIncrementBuild && + !isManagedByEnvVariable(json.CFBundleVersion) ? { CFBundleVersion: getNewVersionCode( programOpts,