Refactor the archiver script

Separate out the translation folders to make where they're defined more
obvious.
This commit is contained in:
Oliver Hamlet
2016-10-13 17:51:08 +01:00
parent ba077600f9
commit f1bad8b68e
+16 -3
View File
@@ -34,6 +34,21 @@ function getGitDescription() {
return `${describe}_${branch}`;
}
function getLanguageFolders() {
return [
'es',
'ru',
'fr',
'zh_CN',
'pl',
'pt_BR',
'fi',
'de',
'da',
'ko',
];
}
function compress(sourcePath, destPath) {
// First remove any existing archive.
fs.removeSync(destPath);
@@ -115,9 +130,7 @@ function createAppArchive(rootPath, releasePath, tempPath, destPath) {
);
// Translation files.
[
'es', 'ru', 'fr', 'zh_CN', 'pl', 'pt_BR', 'fi', 'de', 'da', 'ko',
].forEach((lang) => {
getLanguageFolders().forEach((lang) => {
fs.mkdirsSync(path.join(tempPath, 'resources', 'l10n', lang, 'LC_MESSAGES'));
fs.copySync(
path.join(rootPath, 'resources', 'l10n', lang, 'LC_MESSAGES', 'loot.mo'),