Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.

Commit

Permalink
feat: add a command-line-interface for launching (#378)
Browse files Browse the repository at this point in the history
* feat: add a command-line-interface for launching

* lint
  • Loading branch information
zeke authored Jul 24, 2018
1 parent f9987d2 commit 1236c1c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions cli.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env node

const {spawn} = require('child_process')
const electron = require('electron')
const path = require('path')

const appPath = path.join(__dirname, 'main.js')
const args = [appPath].concat(process.argv.slice(2))
const proc = spawn(electron, args, {stdio: 'inherit'})

proc.on('close', (code) => process.exit(code))
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "ElectronAPIDemos",
"name": "electron-api-demos",
"productName": "Electron API Demos",
"version": "1.3.0",
"description": "Electron interactive API demos",
"private": true,
"main": "main.js",
"bin": "cli.js",
"scripts": {
"start": "electron .",
"dev": "electron . --debug",
Expand Down

0 comments on commit 1236c1c

Please sign in to comment.