Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
catdad committed Apr 28, 2024
1 parent 35e3337 commit 2cb725b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ const pathmap = {};
// is check if all of them resolve to a file, and if they do
// assume that file is a main process file
(function addMainFile(args) {
for (const opt of args) {
for (const arg of args) {
try {
const optPath = path.resolve(opt);
const file = require.resolve(optPath);
const argPath = path.resolve(arg);
const file = require.resolve(argPath);
pathmap[file] = true;
queue({ type: 'discover', file });
} catch (e) {
Expand All @@ -25,6 +25,8 @@ const pathmap = {};
}
}
})(process.argv.slice(3));
// we run `electron --require hook.js ...`
// so remove the first 3 arguments

function exit(code) {
electron.app.on('will-quit', () => {
Expand Down

0 comments on commit 2cb725b

Please sign in to comment.