Skip to content

Commit

Permalink
Merge pull request #5300 from cb1kenobi/timob-16215_3_2_X
Browse files Browse the repository at this point in the history
[TIMOB-16215] Added check to the app name if it contains an ampersand.
  • Loading branch information
ayeung committed Mar 24, 2014
2 parents 09acc8c + e34d6f5 commit a70a969
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions android/cli/commands/_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,22 @@ AndroidBuilder.prototype.validate = function validate(logger, config, cli) {
this.minifyJS = false;
}

// check the app name
if (cli.tiapp.name.indexOf('&') != -1) {
if (config.get('android.allowAppNameAmpersands', false)) {
logger.warn(__('The app name "%s" contains an ampersand (&) which will most likely cause problems.', cli.tiapp.name));
logger.warn(__('It is recommended that you define the app name using i18n strings.'));
logger.warn(__('Refer to %s for more information.', 'http://appcelerator.com/i18n-app-name'.cyan));
} else {
logger.error(__('The app name "%s" contains an ampersand (&) which will most likely cause problems.', cli.tiapp.name));
logger.error(__('It is recommended that you define the app name using i18n strings.'));
logger.error(__('Refer to %s for more information.', 'http://appcelerator.com/i18n-app-name'));
logger.error(__('To allow ampersands in the app name, run:'));
logger.error(' ti config android.allowAppNameAmpersands true\n');
process.exit(1);
}
}

// check the Android specific app id rules
if (!config.get('app.skipAppIdValidation') && !cli.tiapp.properties['ti.skipAppIdValidation']) {
if (!/^([a-zA-Z_]{1}[a-zA-Z0-9_-]*(\.[a-zA-Z0-9_-]*)*)$/.test(cli.tiapp.id)) {
Expand Down

0 comments on commit a70a969

Please sign in to comment.