Skip to content

Commit

Permalink
do no set android:isGame="true" if it's already set
Browse files Browse the repository at this point in the history
  • Loading branch information
Edouard Dorval committed Feb 2, 2016
1 parent 6e8b6c7 commit 3a870a9
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions isgame.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,20 @@ module.exports = function(context) {
if (err) {
throw new Error('Unable to find AndroidManifest.xml: ' + err);
}

var result = data.replace(/<application/g, '<application android:isGame="true"');


var result;

if (!(/<application[^>]*\bandroid:isGame="true"/).test(data)) {

result = data.replace(/<application/g, '<application android:isGame="true"');

}
else {

result = data;

}

fs.writeFile(manifestFile, result, 'utf8', function (err) {
if (err) throw new Error('Unable to write into AndroidManifest.xml: ' + err);
})
Expand Down

0 comments on commit 3a870a9

Please sign in to comment.