piano/grunt/rebrand.js

35 lines
912 B
JavaScript

/*jshint node:true */
'use strict';
var rcedit = require('rcedit');
module.exports = function (grunt) {
grunt.registerMultiTask('rebrand', 'Rebrand .exe', function (platform) {
if (platform !== 'win') {
return;
}
var done = this.async();
rcedit(this.data.src, {
'icon': this.data.icon,
'file-version': this.data.meta.FileVersion,
'product-version': this.data.meta.ProductVersion,
'version-string': this.data.meta
}, function (err) {
if (err) {
grunt.fail.warn(err);
return;
}
done();
});
});
grunt.config('rebrand.rebrand-exe', {
src: 'build/<%= paths.exe[grunt.task.current.args[0]] %>',
icon: 'images/logos/logo.ico',
meta: grunt.config.get('meta')
});
};