Skip to content

Instantly share code, notes, and snippets.

View faytekin's full-sized avatar

Fatih Aytekin faytekin

View GitHub Profile
@faytekin
faytekin / 020_build_version.js
Last active November 16, 2017 15:05 — forked from DavidFrahm/020_build_version.js
Cordova build hook, to use build version from config.xml in your hybrid app
#!/usr/bin/env node
// config.xml => <hook src="hooks/020_build_version.js" type="after_prepare" />
// This plugin replaces text in a file with the app version from config.xml.
module.exports = function(ctx) {
var wwwFileToReplace = "js/index.js";
//var fs = require('fs');
var fs = ctx.requireCordovaModule('fs'),
path = ctx.requireCordovaModule('path'),