(2016-01-28 00:08)AvanOsch Wrote: Thanks for a great plugin Ken.
I want to run a command that normally requires "sudo".
How would I go about doing that?
Thanks for your reply!
The version I downloaded still had the "debug = True", causing a (pydevd) import error.
Maybe you could add a check for the files "pycharm-debug.py3k" and "pycharm-debug.egg", so debug gets skipped if those don't exist...
The latest version has the debug error fixed (again).
I don't have a linux environment up and running to test on, but it seems that you need to call a helper .sh script to invoke the actual script.
Based on: http://unix.stackexchange.com/questions/...h-one-sudo
Set your script to run the helper script, passing the actual script file url as an argument
So the helper script would look like:
sudo "$BASH" -c "$(fc -ln -1)"
You may need to tweak this to get it right. Right now I've been using the git bash on windows for testing .sh and I can't test the whole sudo thing in that context. Perhaps an experienced linux bash person can chime in.
The above is for the command line.
I think it would look something like:
sudo "$BASH" "$@"
I tested and the above works. ("$*" didn't, "$@" does).
To supply a password:
echo mypassword | sudo -S bash "$@"