mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-12-26 08:51:22 -06:00
ELECTRON-1170 - Package dictionary files
This commit is contained in:
parent
2523241353
commit
ecca7ecf54
BIN
dictionaries/en-AU.bdic
Normal file
BIN
dictionaries/en-AU.bdic
Normal file
Binary file not shown.
BIN
dictionaries/en-CA.bdic
Normal file
BIN
dictionaries/en-CA.bdic
Normal file
Binary file not shown.
BIN
dictionaries/en-GB.bdic
Normal file
BIN
dictionaries/en-GB.bdic
Normal file
Binary file not shown.
BIN
dictionaries/en-US.bdic
Normal file
BIN
dictionaries/en-US.bdic
Normal file
Binary file not shown.
BIN
dictionaries/fr-FR.bdic
Normal file
BIN
dictionaries/fr-FR.bdic
Normal file
Binary file not shown.
38
js/main.js
38
js/main.js
@ -7,6 +7,8 @@ const crashReporter = electron.crashReporter;
|
||||
const nodeURL = require('url');
|
||||
const shellPath = require('shell-path');
|
||||
const urlParser = require('url');
|
||||
const { ncp } = require('ncp');
|
||||
const path = require('path');
|
||||
const nodePath = require('path');
|
||||
require('electron-dl')();
|
||||
|
||||
@ -29,8 +31,8 @@ const getCmdLineArg = require('./utils/getCmdLineArg.js');
|
||||
|
||||
//setting the env path child_process issue https://github.com/electron/electron/issues/7688
|
||||
shellPath()
|
||||
.then((path) => {
|
||||
process.env.PATH = path
|
||||
.then((sPath) => {
|
||||
process.env.PATH = sPath
|
||||
})
|
||||
.catch(() => {
|
||||
process.env.PATH = [
|
||||
@ -349,6 +351,7 @@ function setupFirstTimeLaunch(resolve, reject, shouldUpdateUserConfig) {
|
||||
log.send(logLevels.INFO, 'setting first time launch config');
|
||||
getConfigField('launchOnStartup')
|
||||
.then(setStartup)
|
||||
.then(copyDictionaries)
|
||||
.then(() => {
|
||||
if (shouldUpdateUserConfig) {
|
||||
log.send(logLevels.INFO, `Resetting user config data? ${shouldUpdateUserConfig}`);
|
||||
@ -359,6 +362,37 @@ function setupFirstTimeLaunch(resolve, reject, shouldUpdateUserConfig) {
|
||||
.catch(reject);
|
||||
}
|
||||
|
||||
/**
|
||||
* Copies all the dictionaries files required
|
||||
* for spellchecker module
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
function copyDictionaries() {
|
||||
return new Promise(resolve => {
|
||||
if (isMac) {
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
const dictionariesDirName = 'dictionaries';
|
||||
let dictionaryPath;
|
||||
if (isDevEnv) {
|
||||
dictionaryPath = path.join(app.getAppPath(), dictionariesDirName);
|
||||
} else {
|
||||
let execPath = path.dirname(app.getPath('exe'));
|
||||
dictionaryPath = path.join(execPath, isMac ? '..' : '', dictionariesDirName);
|
||||
}
|
||||
const userDictionaries = path.join(app.getPath('userData'), dictionariesDirName);
|
||||
|
||||
ncp(dictionaryPath, userDictionaries, (error) => {
|
||||
if (error) {
|
||||
log.send(logLevels.ERROR, `unable to copy dictionaries ${error}`);
|
||||
}
|
||||
return resolve();
|
||||
});
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets Symphony on startup
|
||||
* @param lStartup
|
||||
|
@ -36,6 +36,7 @@
|
||||
"extraFiles": [
|
||||
"config/Symphony.config",
|
||||
"config/titleBarStyles.css",
|
||||
"dictionaries/**",
|
||||
"library/libsymphonysearch.dylib",
|
||||
"library/cryptoLib.dylib",
|
||||
"library/lz4.exec"
|
||||
@ -100,7 +101,6 @@
|
||||
"glob": "7.1.3",
|
||||
"jest": "23.6.0",
|
||||
"jest-html-reporter": "2.4.2",
|
||||
"ncp": "2.0.0",
|
||||
"robotjs": "0.5.1",
|
||||
"selenium-webdriver": "3.6.0",
|
||||
"wdio-selenium-standalone-service": "0.0.12"
|
||||
@ -122,6 +122,7 @@
|
||||
"lodash.isequal": "4.5.0",
|
||||
"lodash.omit": "4.5.0",
|
||||
"lodash.pick": "4.4.0",
|
||||
"ncp": "2.0.0",
|
||||
"node-osascript": "2.1.0",
|
||||
"ref": "1.3.5",
|
||||
"shell-path": "2.1.0",
|
||||
|
Loading…
Reference in New Issue
Block a user