Skip to content

Commit

Permalink
Merge pull request #362 from catdad/fix-ci
Browse files Browse the repository at this point in the history
updating various dependencies to fix ci build
  • Loading branch information
catdad committed Apr 7, 2024
2 parents 0dddefb + 89efd76 commit f15be23
Show file tree
Hide file tree
Showing 12 changed files with 7,588 additions and 4,799 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
env:
CI: true
FORCE_COLOR: 1
NODE: 14.x
NODE: 18.x

jobs:
linux:
Expand Down
2 changes: 1 addition & 1 deletion lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const name = 'config';
const { info, error } = require('./log.js')(name);
const isomorphic = require('./isomorphic.js');

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

let operation;
let configObj = {
Expand Down
3 changes: 1 addition & 2 deletions lib/gprtools.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ const path = require('path');
const { promisify } = require('util');
const { execFile } = require('child_process');
const fs = require('fs-extra');
const electron = require('electron');
const app = electron.app || electron.remote.app;
const app = require('electron').app || require('@electron/remote').app;

const log = require('./log.js')('gprtools');
const { gprtools } = require('./third-party.js');
Expand Down
25 changes: 18 additions & 7 deletions lib/is.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,29 @@
const get = require('lodash/get');
const electron = require('electron');
const app = get(electron, 'app') || get(electron, 'remote.app');

const pkg = require('../package.json');
const appName = pkg.productName || pkg.name;
const appVersion = pkg.version;
const appData = require('app-data-folder')(appName);

const isPackaged = (() => {
if (
process.mainModule &&
process.mainModule.filename.indexOf('app.asar') !== -1
) {
return true;
}

if (process.argv.filter(a => a.indexOf('app.asar') !== -1).length > 0) {
return true;
}

return false;
})();

module.exports = {
appName,
appVersion,
main: process.type === 'browser',
renderer: process.type === 'renderer',
worker: process.type === 'worker',
prod: app ? app.isPackaged : true,
// ugh, this probably shouldn't be here
userData: app ? app.getPath('userData') : null
prod: isPackaged,
appData
};
5 changes: 5 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ const url = require('url');
const EventEmitter = require('events');
const events = new EventEmitter();

const remote = require('@electron/remote/main');
remote.initialize();

const { app, BrowserWindow, Menu, ipcMain, systemPreferences } = require('electron');

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

remote.enable(mainWindow.webContents);

stayAlive = false;

if (config.getProp('window.maximized')) {
Expand Down
Loading

0 comments on commit f15be23

Please sign in to comment.