Skip to content

Commit f15be23

Browse files
authored
Merge pull request #362 from catdad/fix-ci
updating various dependencies to fix ci build
2 parents 0dddefb + 89efd76 commit f15be23

File tree

12 files changed

+7588
-4799
lines changed

12 files changed

+7588
-4799
lines changed

.github/workflows/build-all.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
env:
99
CI: true
1010
FORCE_COLOR: 1
11-
NODE: 14.x
11+
NODE: 18.x
1212

1313
jobs:
1414
linux:

lib/config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const name = 'config';
88
const { info, error } = require('./log.js')(name);
99
const isomorphic = require('./isomorphic.js');
1010

11-
const location = process.env['RAW_VIEWER_CONFIG_PATH'] || path.resolve(is.prod ? is.userData : root, '.raw-viewer-config.json');
11+
const location = process.env['RAW_VIEWER_CONFIG_PATH'] || path.resolve(is.prod ? is.appData : root, '.raw-viewer-config.json');
1212

1313
let operation;
1414
let configObj = {

lib/gprtools.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ const path = require('path');
22
const { promisify } = require('util');
33
const { execFile } = require('child_process');
44
const fs = require('fs-extra');
5-
const electron = require('electron');
6-
const app = electron.app || electron.remote.app;
5+
const app = require('electron').app || require('@electron/remote').app;
76

87
const log = require('./log.js')('gprtools');
98
const { gprtools } = require('./third-party.js');

lib/is.js

+18-7
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,29 @@
1-
const get = require('lodash/get');
2-
const electron = require('electron');
3-
const app = get(electron, 'app') || get(electron, 'remote.app');
4-
51
const pkg = require('../package.json');
62
const appName = pkg.productName || pkg.name;
73
const appVersion = pkg.version;
4+
const appData = require('app-data-folder')(appName);
5+
6+
const isPackaged = (() => {
7+
if (
8+
process.mainModule &&
9+
process.mainModule.filename.indexOf('app.asar') !== -1
10+
) {
11+
return true;
12+
}
13+
14+
if (process.argv.filter(a => a.indexOf('app.asar') !== -1).length > 0) {
15+
return true;
16+
}
17+
18+
return false;
19+
})();
820

921
module.exports = {
1022
appName,
1123
appVersion,
1224
main: process.type === 'browser',
1325
renderer: process.type === 'renderer',
1426
worker: process.type === 'worker',
15-
prod: app ? app.isPackaged : true,
16-
// ugh, this probably shouldn't be here
17-
userData: app ? app.getPath('userData') : null
27+
prod: isPackaged,
28+
appData
1829
};

main.js

+5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ const url = require('url');
33
const EventEmitter = require('events');
44
const events = new EventEmitter();
55

6+
const remote = require('@electron/remote/main');
7+
remote.initialize();
8+
69
const { app, BrowserWindow, Menu, ipcMain, systemPreferences } = require('electron');
710

811
require('./lib/app-id.js')(app);
@@ -87,6 +90,8 @@ function createWindow () {
8790
// Create the browser window.
8891
mainWindow = new BrowserWindow(windowOptions);
8992

93+
remote.enable(mainWindow.webContents);
94+
9095
stayAlive = false;
9196

9297
if (config.getProp('window.maximized')) {

0 commit comments

Comments
 (0)