Skip to content

Commit

Permalink
Allow passing cli options when starting electron app from cli
Browse files Browse the repository at this point in the history
Fixes #25
Fixes #24
  • Loading branch information
andrew committed Jun 15, 2021
1 parent 5532280 commit 58c85d5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const {app, Menu, Tray, shell} = require('electron')
const path = require('path')
const createServer = require('./lib/server')
const forage = require('./lib/forage')
const { hideBin, Parser } = require('yargs/helpers')

const assetsDirectory = path.join(__dirname, 'assets')

Expand All @@ -23,8 +24,10 @@ var tray = undefined
var win = undefined
var db
var started = false
var topic = 'forage'
var port = 8005

var argv = Parser(hideBin(process.argv), {default: {port: 8005, topic: 'forage'}})
var port = argv.port
var topic = argv.topic

if(os.platform() === 'darwin'){
// Don't show the app in the doc
Expand Down

0 comments on commit 58c85d5

Please sign in to comment.