From 9778c4fba26562e689d0b9264770f792ea15a839 Mon Sep 17 00:00:00 2001 From: Yuya Ochiai Date: Wed, 15 Jun 2016 00:19:41 +0900 Subject: [PATCH] Override author of dist/package.json "Mattermost, Inc." is used: - to create the start menu shortcut. - as the publisher on "Add/Remove Programs" list. --- gulpfile.js | 14 ++++++++++---- script/installer.js | 2 ++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 2c3aa24d..4d56cc83 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -14,6 +14,7 @@ var electron = require('electron-connect').server.create({ path: './dist' }); var packager = require('electron-packager'); +const fs = require('fs'); var sources = ['**/*.js', '**/*.json', '**/*.css', '**/*.html', '!**/node_modules/**', '!dist/**', '!release/**', '!**/test_config.json']; @@ -77,9 +78,15 @@ gulp.task('prettify:jsx:verify', function() { }); -gulp.task('build', ['sync-meta', 'webpack', 'copy'], function() { - return gulp.src('src/package.json') - .pipe(gulp.dest('dist')); +gulp.task('build', ['sync-meta', 'webpack', 'copy'], function(cb) { + const appPackageJson = require('./src/package.json'); + const distPackageJson = Object.assign({}, appPackageJson, { + author: { + name: 'Mattermost, Inc.', + email: 'noreply' + } + }); + fs.writeFile('./dist/package.json', JSON.stringify(distPackageJson, null, ' '), cb); }); gulp.task('webpack', ['webpack:main', 'webpack:browser', 'webpack:webview']); @@ -239,6 +246,5 @@ gulp.task('sync-meta', function() { appPackageJson.description = packageJson.description; appPackageJson.author = packageJson.author; appPackageJson.license = packageJson.license; - var fs = require('fs'); fs.writeFileSync('./src/package.json', JSON.stringify(appPackageJson, null, ' ') + '\n'); }); diff --git a/script/installer.js b/script/installer.js index 49dcc3fe..f867c4a2 100644 --- a/script/installer.js +++ b/script/installer.js @@ -21,6 +21,8 @@ function getInstallerConfig(arch) { return Promise.resolve({ appDirectory: path.join(outPath, `Mattermost-win32-${arch}`), + authors: 'Mattermost, Inc.', + owners: 'Mattermost, Inc.', iconUrl: 'https://raw.githubusercontent.com/mattermost/desktop/master/resources/icon.ico', //loadingGif: path.join(rootPath, 'assets', 'img', 'loading.gif'), noMsi: true,