From e09e15f72fc9fbccf5b3921abbf32f4ddceedcf4 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Thu, 7 Sep 2017 10:42:25 -0400 Subject: [PATCH] modify appxmanifest version on dist --- gulpfile.js | 21 ++++++++++++++++++++- package.json | 3 ++- store/windows/AppxManifest.xml | 2 +- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 51bb352ab0..30d7c0d815 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -14,7 +14,9 @@ jeditor = require("gulp-json-editor"), gulpUtil = require('gulp-util'), child = require('child_process'), - zip = require('gulp-zip'); + zip = require('gulp-zip'), + manifest = require('./src/manifest.json'), + xmlpoke = require('gulp-xmlpoke'); var paths = {}; paths.dist = './dist/'; @@ -296,6 +298,23 @@ gulp.task('dist-edge', ['dist'], function (cb) { .pipe(gulp.dest(paths.dist + 'Extension')) .on('end', resolve); }); + }).then(function () { + // modify appxmanifest + return new Promise(function (resolve, reject) { + gulp.src(paths.dist + '/AppxManifest.xml') + .pipe(xmlpoke({ + replacements: [{ + xpath: '/p:Package/p:Identity/@Version', + value: manifest.version + '.0', + namespaces: { + 'p': 'http://schemas.microsoft.com/appx/manifest/foundation/windows10' + } + }] + })) + .on('error', reject) + .pipe(gulp.dest(paths.dist)) + .on('end', resolve); + }); }).then(function () { // makeappx.exe must be in your system's path already child.spawn('makeappx.exe', ['pack', '/h', 'SHA256', '/d', paths.dist, '/p', paths.dist + 'bitwarden.appx']); diff --git a/package.json b/package.json index 698b9e7527..4c21f10645 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ "web-ext": "2.0.0", "child_process": "1.0.2", "gulp-util": "3.0.8", - "gulp-zip": "4.0.0" + "gulp-zip": "4.0.0", + "gulp-xmlpoke": "0.2.1" } } diff --git a/store/windows/AppxManifest.xml b/store/windows/AppxManifest.xml index 01ab142ff9..1cd77b427e 100644 --- a/store/windows/AppxManifest.xml +++ b/store/windows/AppxManifest.xml @@ -8,7 +8,7 @@ + Version="0.0.0.0"/> bitwarden - Free Password Manager