Skip to content

Commit

Permalink
chore: Update file paths in build.js and build.tester.js for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
truemiller committed Jul 17, 2024
1 parent 3f67622 commit 4b3332c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
14 changes: 7 additions & 7 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ const main = async () => {
appId: "xyz.valory.olas-operate-app",
artifactName: "${productName}-${version}-${platform}-${arch}.${ext}",
productName: "Pearl",
files: ["electron/**/*", "package.json", "app-update.yml"],
files: ["./electron/**/*", "./package.json", "./app-update.yml"],
directories: {
output: "dist",
output: "./dist",
},
extraResources: [
{
from: "electron/bins",
from: "./electron/bins",
to: "bins",
filter: ["**/*"],
},
Expand All @@ -45,12 +45,12 @@ const main = async () => {
},
],
publish: publishOptions,
category: "public.app-category.utilities",
icon: "electron/assets/icons/splash-robot-head-dock.png",
category: "./public.app-category.utilities",
icon: "./electron/assets/icons/splash-robot-head-dock.png",
hardenedRuntime: true,
gatekeeperAssess: false,
entitlements: "electron/entitlements.mac.plist",
entitlementsInherit: "electron/entitlements.mac.plist",
entitlements: "./electron/entitlements.mac.plist",
entitlementsInherit: "./electron/entitlements.mac.plist",
notarize: {
teamId: process.env.APPLETEAMID,
},
Expand Down
8 changes: 4 additions & 4 deletions build.tester.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ const main = async () => {
appId: 'xyz.valory.olas-operate-app',
artifactName: '${productName}-${version}-${platform}-${arch}.${ext}',
productName: 'Pearl',
files: ['electron/**/*', 'package.json', 'dev-app-update.yml'],
files: ['./electron/**/*', './package.json', './dev-app-update.yml'],
directories: {
output: 'dist',
output: './dist',
},
extraResources: [
{
from: 'electron/bins',
from: './electron/bins',
to: 'bins',
filter: ['**/*'],
},
],
],
// NOTE - Edit this for your own platform, or leave it commented for default settings
// mac: {
// publish: null,
Expand Down
10 changes: 7 additions & 3 deletions electron/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,9 @@ const createSplashWindow = () => {
splashWindow.loadURL('file://' + import.meta.dirname + '/loading/index.html');

if (isDev) {
splashWindow.webContents.openDevTools();
splashWindow.webContents.openDevTools({
mode: 'detach',
});
}
};

Expand Down Expand Up @@ -263,7 +265,7 @@ const createMainWindow = async () => {
await setupStoreIpc(ipcMain, mainWindow, storeInitialValues);

if (isDev) {
mainWindow.webContents.openDevTools();
mainWindow.webContents.openDevTools({ mode: 'detach' });
}
};

Expand Down Expand Up @@ -354,7 +356,7 @@ async function launchDaemonDev() {
async function launchNextApp() {
const nextApp = next({
dev: false,
dir: path.join(import.meta.dirname),
dir: '.',
port: appConfig.ports.prod.next,
env: {
...process.env,
Expand All @@ -364,6 +366,7 @@ async function launchNextApp() {
: appConfig.ports.dev.operate,
},
});

await nextApp.prepare();

const server = http.createServer(nextApp.getRequestHandler);
Expand Down Expand Up @@ -477,6 +480,7 @@ ipcMain.on('check', async function (event, _argument) {

// APP-SPECIFIC EVENTS
app.on('ready', async () => {
logger.electron('App ready');
createTray();
if (isMac) {
app.dock?.setIcon(
Expand Down
2 changes: 2 additions & 0 deletions electron/utils/processes.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { exec } from 'child_process';
import psTree from 'ps-tree';

import { isWindows } from '../constants/os.js';
import { logger } from './logger.js';

const unixKillCommand = 'kill -9';
const windowsKillCommand = 'taskkill /F /PID';
Expand All @@ -13,6 +14,7 @@ const windowsKillCommand = 'taskkill /F /PID';
* @returns {Promise<void>} A promise that resolves when the process and its children are killed, or rejects with an error.
*/
export function killProcesses(pid) {
logger.electron('Killing processes...', pid);
return new Promise((resolve, reject) => {
psTree(pid, (err, children) => {
if (err) {
Expand Down

0 comments on commit 4b3332c

Please sign in to comment.