diff options
author | Stefan <stefan@adlk.io> | 2018-12-13 17:21:02 +0100 |
---|---|---|
committer | Stefan <stefan@adlk.io> | 2018-12-13 17:21:02 +0100 |
commit | 74b1ad5d9cba28faa9ae2f29f922f3423f3d2e4e (patch) | |
tree | 32cad71beaf83e23086ee619c6d24520ce6c9bdd /gulpfile.babel.js | |
parent | Ignore clicks on premium elements (diff) | |
download | ferdium-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.js | 30 |
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'; | |||
6 | import { exec } from 'child_process'; | 6 | import { exec } from 'child_process'; |
7 | import dotenv from 'dotenv'; | 7 | import dotenv from 'dotenv'; |
8 | import sassVariables from 'gulp-sass-variables'; | 8 | import sassVariables from 'gulp-sass-variables'; |
9 | import { removeSync } from 'fs-extra'; | 9 | import { moveSync, removeSync } from 'fs-extra'; |
10 | import kebabCase from 'kebab-case'; | 10 | import kebabCase from 'kebab-case'; |
11 | import hexRgb from 'hex-rgb'; | 11 | import hexRgb from 'hex-rgb'; |
12 | import path from 'path'; | ||
12 | 13 | ||
13 | import config from './package.json'; | 14 | import config from './package.json'; |
14 | 15 | ||
@@ -45,6 +46,7 @@ const paths = { | |||
45 | }; | 46 | }; |
46 | 47 | ||
47 | function _shell(cmd, cb) { | 48 | function _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 | ||
153 | export function sign(done) { | 167 | export function sign(done) { |