diff options
author | Stefan Malzner <stefan@adlk.io> | 2018-12-07 13:47:00 +0100 |
---|---|---|
committer | Stefan Malzner <stefan@adlk.io> | 2018-12-07 13:47:00 +0100 |
commit | 0cdc165ace53019371fc126d8d76817f1f2ed027 (patch) | |
tree | 1c98c3e31258c29ff2f49b748b9df16a892f66e6 /build-helpers | |
parent | Bump version to b20 (diff) | |
download | ferdium-app-0cdc165ace53019371fc126d8d76817f1f2ed027.tar.gz ferdium-app-0cdc165ace53019371fc126d8d76817f1f2ed027.tar.zst ferdium-app-0cdc165ace53019371fc126d8d76817f1f2ed027.zip |
fix(Spellchecker): Dictionaries are now part of app instead of dynamic download
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`); | ||