You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 23, 2021. It is now read-only.
How hard would it be to allow the child process to be spawned instead of executed on this module? I didn't take a look myself, but I suspect it's just a matter of spawning the final command built by this module in Attempt().
The use case is that we've figured out how to call the process that needs the elevation in Etcher, instead of the full application, but we need to consume its stdout and stderr while it runs in order to get state information.
In my mind, the sudoPrompt.spawn() function should just return the spawn object for the client to handle.
What do you think about this addition? Happy to collaborate on it.
The text was updated successfully, but these errors were encountered:
It is possible but would be a fair amount of work. Would be great if you could tackle it.
The Attempt() call is just the tip of the iceberg. That's there to try and run the command if a sudo session already exists, and if it does then that could be just a straight-forward spawn() instance passed back to the user.
But otherwise, the user command is run by a bash subshell which is called by the applet after acquiring administrator privileges. So we would essentially be trying to create a fake spawn() instance with all the same properties as a normal Node.js spawn() instance, but which wraps a bash subshell.
Before granting privileges, take a look at the logged path and then open it in Finder and make a copy of the temp app. The app will otherwise be deleted as soon as privileges are granted.
Open the app with Script Editor to view the Apple Script source, and then take a look in the MacOS directory within the app to see the bash scripts which are there.
If we can do this properly that would be great, but some aspects of the spawn() instance might be difficult to copy perfectly. Alternatively, it might be easier to write out your script's stdout and stderr streams to a file and tail those.
Hey there,
How hard would it be to allow the child process to be spawned instead of executed on this module? I didn't take a look myself, but I suspect it's just a matter of spawning the final command built by this module in
Attempt()
.The use case is that we've figured out how to call the process that needs the elevation in Etcher, instead of the full application, but we need to consume its
stdout
andstderr
while it runs in order to get state information.In my mind, the
sudoPrompt.spawn()
function should just return thespawn
object for the client to handle.What do you think about this addition? Happy to collaborate on it.
The text was updated successfully, but these errors were encountered: