Skip to content

Commit

Permalink
fix(Spellchecker): Dictionaries are now part of app instead of dynami…
Browse files Browse the repository at this point in the history
…c download
  • Loading branch information
adlk committed Dec 7, 2018
1 parent ed1554f commit 0cdc165
Show file tree
Hide file tree
Showing 9 changed files with 370 additions and 644 deletions.
24 changes: 24 additions & 0 deletions build-helpers/installDictionaries.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const { execSync } = require('child_process');
const { SPELLCHECKER_LOCALES } = require('../build/i18n/languages');

const path = './build/dictionaries';

let packages = '';
Object.keys(SPELLCHECKER_LOCALES).forEach((key) => { packages = `${packages} hunspell-dict-${key}`; });

function exec(cmd) {
execSync(cmd,
(error, stdout, stderr) => {
console.log(`stdout: ${stdout}`);
console.log(`stderr: ${stderr}`);
if (error !== null) {
console.log(`exec error: ${error}`);
}
});
}

exec(`
rm -rf ${path}
npm install --prefix ${path} ${packages}
mv ${path}/node_modules/* ${path}
rm -rf ${path}/node_modules ${path}/package-lock.json`);
2 changes: 2 additions & 0 deletions electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,5 @@ nsis:
protocols:
name: Franz
schemes: [franz]

asarUnpack: "./dictionaries"
1 change: 0 additions & 1 deletion gulpfile.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ export function sign(done) {
}

const build = gulp.series(
clean,
gulp.parallel(mvSrc, mvPackageJson),
gulp.parallel(html, scripts, styles),
);
Expand Down
Loading

0 comments on commit 0cdc165

Please sign in to comment.