fix issue with app_name containing apostrophes

This commit is contained in:
Julien Bouquillon 2016-03-10 18:17:42 +01:00
parent 82582e5a5b
commit 2cefb42559

View File

@ -120,7 +120,7 @@ function updateProjectAccordingTo(platformConfig, locations) {
// Update app name by editing res/values/strings.xml
var name = platformConfig.name();
var strings = xmlHelpers.parseElementtreeSync(locations.strings);
strings.find('string[@name="app_name"]').text = name;
strings.find('string[@name="app_name"]').text = name.replace(/\'/g, '\\\'');
fs.writeFileSync(locations.strings, strings.write({indent: 4}), 'utf-8');
events.emit('verbose', 'Wrote out Android application name to "' + name + '"');