From 44d791dd7580876d4154595520fc673dfc4c5e9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Esp=C3=ADn?= Date: Sun, 27 Sep 2020 11:21:01 +0200 Subject: [PATCH] (wip) Fix --preload behavior --- lib/run.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/run.js b/lib/run.js index 128853b..ae75d6f 100644 --- a/lib/run.js +++ b/lib/run.js @@ -52,7 +52,6 @@ exports.builder = yargs => { requiresArg: true }, script: { - alias: 'preload', describe: 'Load module in renderer via script tag', group: 'Electron', implies: 'renderer', @@ -115,7 +114,15 @@ exports.builder = yargs => { if (argv.script) { argv.script = argv.script.map(script => resolve(script)) } - + if (argv.preload) { + try { + argv.preload = join(process.cwd(), argv.preload) + } catch (e) { + throw errors.createMissingArgumentError( + `--preload requires file path [${e.code}].` + ) + } + } return true }) }