Skip to content

Instantly share code, notes, and snippets.

@jessehattabaugh
Last active August 23, 2016 19:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jessehattabaugh/def84d1d6b7a1e43b765 to your computer and use it in GitHub Desktop.
Save jessehattabaugh/def84d1d6b7a1e43b765 to your computer and use it in GitHub Desktop.
Gulp task for changing values in PhoneGap's config.xml file
/* Config - set the right values in the PhoneGap config.xml
******************************************************************************/
gulp.task('config', function () {
return gulp.src([srcDir + '/config.xml'])
.pipe(cheerio({
run: function ($) {
// get the version number from package.json
$('widget').attr('version', require('./package').version);
// in development launch the app with a different html file
$('content').attr('src', process.env.NODE_ENV == 'development' ? 'debug.html' : 'index.html');
},
parserOptions: {
xmlMode: true
}
}))
.pipe(gulp.dest(destDir));
});
@RangerMauve
Copy link

This seems to screw up on the <allow-intent> tags since they aren't proper HTML.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment