This repository has been archived by the owner on Oct 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 127
Question : How to pass custom command line arguments ? #45
Comments
You just pass then after your script file // save as test.js
console.log(process.argv) and then npm install -g electron-prebuilt
electron test.js hello world |
Thanks for the quick response.
Here is my code var electron = require('electron-prebuilt')
var proc = require('child_process')
// will something similar to print /Users/maf/.../Electron
console.log(electron)
// spawn electron
var child = proc.spawn(electron, ["./app", "foo=bar"]); |
I just figured out that it works for me if I hold a copy of process.env.XXXargv = JSON.stringify(process.argv) ; |
The renderer process can access the main process argv like so:
|
can these command line args be passes to an electron apps .exe windows version of the app like:
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi! I d like to pass custom command line arguments to have them available at
process.argv
. Is there a way to submit values?The text was updated successfully, but these errors were encountered: