aboutsummaryrefslogtreecommitdiffstats
path: root/gulpfile.babel.js
diff options
context:
space:
mode:
authorLibravatar Stefan <stefan@adlk.io>2018-12-13 17:21:02 +0100
committerLibravatar Stefan <stefan@adlk.io>2018-12-13 17:21:02 +0100
commit74b1ad5d9cba28faa9ae2f29f922f3423f3d2e4e (patch)
tree32cad71beaf83e23086ee619c6d24520ce6c9bdd /gulpfile.babel.js
parentIgnore clicks on premium elements (diff)
downloadferdium-app-74b1ad5d9cba28faa9ae2f29f922f3423f3d2e4e.tar.gz
ferdium-app-74b1ad5d9cba28faa9ae2f29f922f3423f3d2e4e.tar.zst
ferdium-app-74b1ad5d9cba28faa9ae2f29f922f3423f3d2e4e.zip
Fix windows dictionary install
Diffstat (limited to 'gulpfile.babel.js')
-rw-r--r--gulpfile.babel.js30
1 files changed, 22 insertions, 8 deletions
diff --git a/gulpfile.babel.js b/gulpfile.babel.js
index fc2820fed..74b183a1d 100644
--- a/gulpfile.babel.js
+++ b/gulpfile.babel.js
@@ -6,9 +6,10 @@ import server from 'gulp-server-livereload';
6import { exec } from 'child_process'; 6import { exec } from 'child_process';
7import dotenv from 'dotenv'; 7import dotenv from 'dotenv';
8import sassVariables from 'gulp-sass-variables'; 8import sassVariables from 'gulp-sass-variables';
9import { removeSync } from 'fs-extra'; 9import { moveSync, removeSync } from 'fs-extra';
10import kebabCase from 'kebab-case'; 10import kebabCase from 'kebab-case';
11import hexRgb from 'hex-rgb'; 11import hexRgb from 'hex-rgb';
12import path from 'path';
12 13
13import config from './package.json'; 14import config from './package.json';
14 15
@@ -45,6 +46,7 @@ const paths = {
45}; 46};
46 47
47function _shell(cmd, cb) { 48function _shell(cmd, cb) {
49 console.log('executing', cmd);
48 exec(cmd, { 50 exec(cmd, {
49 cwd: paths.dest, 51 cwd: paths.dest,
50 }, (error, stdout, stderr) => { 52 }, (error, stdout, stderr) => {
@@ -141,13 +143,25 @@ export function dictionaries(done) {
141 let packages = ''; 143 let packages = '';
142 Object.keys(SPELLCHECKER_LOCALES).forEach((key) => { packages = `${packages} hunspell-dict-${key}`; }); 144 Object.keys(SPELLCHECKER_LOCALES).forEach((key) => { packages = `${packages} hunspell-dict-${key}`; });
143 145
144 _shell(` 146 if (process.platform !== 'win32') {
145 rm -rf ${paths.dictionaries} 147 _shell(`
146 npm install --prefix ${paths.dictionaries} ${packages} 148 rm -rf ${paths.dictionaries}
147 mv ${paths.dictionaries}/node_modules/* ${paths.dictionaries} 149 npm install --prefix ${path.join(__dirname, paths.dictionaries)} ${packages}
148 rm -rf ${paths.dictionaries}/node_modules ${paths.dictionaries}/package-lock.json 150 mv ${paths.dictionaries}/node_modules/* ${paths.dictionaries}
149 pwd`, 151 rm -rf ${paths.dictionaries}/node_modules ${paths.dictionaries}/package-lock.json`,
150 done); 152 done);
153 } else {
154 _shell(`npm install --prefix ${path.join(__dirname, 'temp')} ${packages}`, () => {
155 moveSync(
156 path.join(__dirname, 'temp', 'node_modules'),
157 path.join(__dirname, 'build', paths.dictionaries)
158 );
159
160 removeSync(path.join(__dirname, 'temp'));
161
162 done();
163 });
164 }
151} 165}
152 166
153export function sign(done) { 167export function sign(done) {