aboutsummaryrefslogtreecommitdiffstats
path: root/build-helpers
diff options
context:
space:
mode:
authorLibravatar Stefan Malzner <stefan@adlk.io>2018-12-07 13:47:00 +0100
committerLibravatar Stefan Malzner <stefan@adlk.io>2018-12-07 13:47:00 +0100
commit0cdc165ace53019371fc126d8d76817f1f2ed027 (patch)
tree1c98c3e31258c29ff2f49b748b9df16a892f66e6 /build-helpers
parentBump version to b20 (diff)
downloadferdium-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-xbuild-helpers/installDictionaries.js24
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 @@
1const { execSync } = require('child_process');
2const { SPELLCHECKER_LOCALES } = require('../build/i18n/languages');
3
4const path = './build/dictionaries';
5
6let packages = '';
7Object.keys(SPELLCHECKER_LOCALES).forEach((key) => { packages = `${packages} hunspell-dict-${key}`; });
8
9function 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
20exec(`
21rm -rf ${path}
22npm install --prefix ${path} ${packages}
23mv ${path}/node_modules/* ${path}
24rm -rf ${path}/node_modules ${path}/package-lock.json`);