Skip to content

Commit

Permalink
Fixed, --preload now has the behavior it should have
Browse files Browse the repository at this point in the history
  • Loading branch information
marc2332 authored and inukshuk committed Sep 29, 2020
1 parent 44d791d commit 68fd2cb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
7 changes: 7 additions & 0 deletions lib/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ exports.builder = yargs => {
implies: 'renderer',
type: 'string',
requiresArg: true
},
preload: {
describe: 'Preload script',
group: 'Electron',
implies: 'renderer',
type: 'string',
requiresArg: true
}
})
.check(argv => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "electron-mocha",
"version": "9.1.0",
"version": "9.2.0",
"description": "Mocha tests in Electron.",
"main": "lib/main.js",
"scripts": {
Expand Down
4 changes: 4 additions & 0 deletions renderer/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ require('electron-window').parseArgs()
const { ipcRenderer: ipc } = require('electron')
const opts = window.__args__

if(opts.preload){
require(opts.preload)
}

if (!opts.interactive) {
require('./console')
}
Expand Down

0 comments on commit 68fd2cb

Please sign in to comment.