Last active
August 23, 2016 19:31
-
-
Save jessehattabaugh/def84d1d6b7a1e43b765 to your computer and use it in GitHub Desktop.
Gulp task for changing values in PhoneGap's config.xml file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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)); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This seems to screw up on the
<allow-intent>
tags since they aren't proper HTML.