Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updating various dependencies to fix ci build #362

Merged
merged 4 commits into from
Apr 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading