mirror of
https://github.com/bitwarden/browser
synced 2025-12-11 13:53:34 +00:00
modify appxmanifest version on dist
This commit is contained in:
21
gulpfile.js
21
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']);
|
||||
|
||||
Reference in New Issue
Block a user