Skip to content

Commit

Permalink
enhancement: support getting active windows in packaged electron envi…
Browse files Browse the repository at this point in the history
…ronments
  • Loading branch information
Timeo Williams committed Sep 25, 2024
1 parent 6e84e52 commit 9d936a7
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/macos.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,20 @@ import path from 'node:path';
import {promisify} from 'node:util';
import childProcess from 'node:child_process';
import {fileURLToPath} from 'node:url';
import process from 'node:process';

const __dirname = path.dirname(fileURLToPath(import.meta.url));

const execFile = promisify(childProcess.execFile);
const binary = path.join(__dirname, '../main');

let binary = path.join(__dirname, '../main');

// Detect if running in packaged mode using process.resourcesPath
const isPackaged = process.resourcesPath !== process.cwd();

if (isPackaged) {
binary = path.join(process.resourcesPath, 'app.asar.unpacked','node_modules', 'get-windows', 'main');

Check failure on line 17 in lib/macos.js

View workflow job for this annotation

GitHub Actions / Node.js 18

A space is required after ','.
}

const parseMac = stdout => {
try {
Expand Down

0 comments on commit 9d936a7

Please sign in to comment.