From 2cb725ba62e5f6af74ce055e446f0af6d68ef223 Mon Sep 17 00:00:00 2001 From: Kiril Vatev Date: Sun, 28 Apr 2024 01:04:29 -0400 Subject: [PATCH] cleanup --- src/hook.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/hook.js b/src/hook.js index 2a2a443..bc61618 100644 --- a/src/hook.js +++ b/src/hook.js @@ -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) { @@ -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', () => {