diff options
Diffstat (limited to 'build-helpers')
-rwxr-xr-x | build-helpers/installDictionaries.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/build-helpers/installDictionaries.js b/build-helpers/installDictionaries.js new file mode 100755 index 000000000..8d209356e --- /dev/null +++ b/build-helpers/installDictionaries.js | |||
@@ -0,0 +1,24 @@ | |||
1 | const { execSync } = require('child_process'); | ||
2 | const { SPELLCHECKER_LOCALES } = require('../build/i18n/languages'); | ||
3 | |||
4 | const path = './build/dictionaries'; | ||
5 | |||
6 | let packages = ''; | ||
7 | Object.keys(SPELLCHECKER_LOCALES).forEach((key) => { packages = `${packages} hunspell-dict-${key}`; }); | ||
8 | |||
9 | function exec(cmd) { | ||
10 | execSync(cmd, | ||
11 | (error, stdout, stderr) => { | ||
12 | console.log(`stdout: ${stdout}`); | ||
13 | console.log(`stderr: ${stderr}`); | ||
14 | if (error !== null) { | ||
15 | console.log(`exec error: ${error}`); | ||
16 | } | ||
17 | }); | ||
18 | } | ||
19 | |||
20 | exec(` | ||
21 | rm -rf ${path} | ||
22 | npm install --prefix ${path} ${packages} | ||
23 | mv ${path}/node_modules/* ${path} | ||
24 | rm -rf ${path}/node_modules ${path}/package-lock.json`); | ||