Skip to content

Commit

Permalink
(wip) Fix --preload behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
marc2332 authored and inukshuk committed Sep 29, 2020
1 parent 12c0233 commit 44d791d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ exports.builder = yargs => {
requiresArg: true
},
script: {
alias: 'preload',
describe: 'Load module in renderer via script tag',
group: 'Electron',
implies: 'renderer',
Expand Down Expand Up @@ -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
})
}
Expand Down

0 comments on commit 44d791d

Please sign in to comment.