From f1bad8b68e5129557d5a5b0a9acef795bdbf8a65 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Thu, 13 Oct 2016 17:31:56 +0100 Subject: [PATCH] Refactor the archiver script Separate out the translation folders to make where they're defined more obvious. --- scripts/archive.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/scripts/archive.js b/scripts/archive.js index eab84d30..5e0c58ee 100644 --- a/scripts/archive.js +++ b/scripts/archive.js @@ -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'),