Refactor external source files to live in app/

This commit is contained in:
David Balatero 2017-06-21 17:31:20 -07:00 committed by Scott Nonnenberg
parent db62494109
commit ed831dacd0
No known key found for this signature in database
GPG Key ID: A4931C09644C654B
6 changed files with 13 additions and 9 deletions

View File

@ -11,7 +11,14 @@ function normalizeLocaleName(locale) {
function getLocaleMessages(locale) { function getLocaleMessages(locale) {
const onDiskLocale = locale.replace('-', '_'); const onDiskLocale = locale.replace('-', '_');
const targetFile = path.join(__dirname, '_locales', onDiskLocale, 'messages.json');
const targetFile = path.join(
__dirname,
'..',
'_locales',
onDiskLocale,
'messages.json'
);
return JSON.parse(fs.readFileSync(targetFile, 'utf-8')) return JSON.parse(fs.readFileSync(targetFile, 'utf-8'))
} }

View File

@ -9,9 +9,9 @@ const Menu = electron.Menu;
const shell = electron.shell; const shell = electron.shell;
const ElectronConfig = require('electron-config'); const ElectronConfig = require('electron-config');
const autoupdate = require('./autoupdate'); const autoupdate = require('./app/autoupdate');
const locale = require('./locale'); const locale = require('./app/locale');
const windowState = require('./window_state'); const windowState = require('./app/window_state');
console.log('setting AUMID'); console.log('setting AUMID');
app.setAppUserModelId('org.whispersystems.signal-desktop') app.setAppUserModelId('org.whispersystems.signal-desktop')
@ -213,7 +213,7 @@ app.on('ready', function() {
createWindow(); createWindow();
let template = require('./menu.js'); let template = require('./app/menu.js');
if (process.platform === 'darwin') { if (process.platform === 'darwin') {
template[3].submenu[3].click = function() { template[3].submenu[3].click = function() {
mainWindow.show(); mainWindow.show();

View File

@ -109,12 +109,9 @@
"stylesheets/*.css", "stylesheets/*.css",
"!js/register.js", "!js/register.js",
"!js/views/standalone_registration_view.js", "!js/views/standalone_registration_view.js",
"app/*",
"preload.js", "preload.js",
"window_state.js",
"autoupdate.js",
"locale.js",
"main.js", "main.js",
"menu.js",
"audio/**", "audio/**",
"images/**", "images/**",
"fonts/*", "fonts/*",