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

enhancement: support getting active windows in packaged electron envi… #192

Closed
wants to merge 1 commit into from
Closed
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
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 {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
Loading