[build] refactoring

This commit is contained in:
Maxim Kadushkin 2022-01-18 11:22:44 +03:00 committed by Julia Radzhabova
parent 0f7cd84acf
commit d53adf634d

View file

@ -33,7 +33,7 @@ module.exports = function(grunt) {
return !!string && !!iconv_lite ? iconv_lite.encode(string,encoding) : string; return !!string && !!iconv_lite ? iconv_lite.encode(string,encoding) : string;
}; };
var jsreplacements = [ global.jsreplacements = [
{ {
from: /\{\{SUPPORT_EMAIL\}\}/g, from: /\{\{SUPPORT_EMAIL\}\}/g,
to: _encode(process.env.SUPPORT_EMAIL) || 'support@onlyoffice.com' to: _encode(process.env.SUPPORT_EMAIL) || 'support@onlyoffice.com'
@ -355,12 +355,12 @@ module.exports = function(grunt) {
replacements: [{ replacements: [{
from: /\{\{PRODUCT_VERSION\}\}/g, from: /\{\{PRODUCT_VERSION\}\}/g,
to: packageFile.version to: packageFile.version
}] }, ...global.jsreplacements]
}, },
prepareHelp: { prepareHelp: {
src: ['<%= pkg.main.copy.help[0].dest %>/ru/**/*.htm*'], src: ['<%= pkg.main.copy.help[0].dest %>/ru/**/*.htm*'],
overwrite: true, overwrite: true,
replacements: [] replacements: [...helpreplacements]
} }
}, },
@ -427,10 +427,10 @@ module.exports = function(grunt) {
} }
}); });
var replace = grunt.config.get('replace'); // var replace = grunt.config.get('replace');
replace.writeVersion.replacements.push(...jsreplacements); // replace.writeVersion.replacements.push(...global.jsreplacements);
replace.prepareHelp.replacements.push(...helpreplacements); // replace.prepareHelp.replacements.push(...helpreplacements);
grunt.config.set('replace', replace); // grunt.config.set('replace', replace);
}); });
grunt.registerTask('deploy-reporter', function(){ grunt.registerTask('deploy-reporter', function(){