electron-sudo
electron-sudo copied to clipboard
Fix Linux platform (specifically getBinary(), exec(), and spawn())
There was a bug in the SudoerLinux.getBinary() function which replaced the path with an object, causing [object Object] to appear as the binary path.
There was another bug in SudoerLinux.exec() and SudoerLinux.spawn() which prevented the DISPLAY variable from being set correctly if options.env isn't provided.
A (good) side effect of the fix for the exec/spawn bug is that both functions now use env just like the native Node.js equivalents (Node passes your current process.env if you don't specify the env option).
Tested and working on my machine. :+1:
@facekapow I found a further bug in the Linux support, which only shows up if you don't have gksudo installed. If you fast-forward merge my commit, it will fix that (the explanation of the bug is in the commit message).
@malept Nice find, thanks! I've merged it in.
tnx, i'll fix it very soon
Now code is being refactored and i will add you fix in new code