Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there any way to excecute :post-build with sudo? #725

Closed
Lodger opened this issue Mar 23, 2021 · 5 comments
Closed

Is there any way to excecute :post-build with sudo? #725

Lodger opened this issue Mar 23, 2021 · 5 comments

Comments

@Lodger
Copy link

Lodger commented Mar 23, 2021

Hello, I have this recipe for EMMS:

'(emms
   :type git
   :flavor melpa
   :files ("*.el" "lisp/*.el" "doc/emms.texinfo" "emms-pkg.el" "src/*")
   :repo "https://git.savannah.gnu.org/git/emms.git"
   :post-build (("make" "emms-print-metadata") ("mv" "src/emms-print-metadata" "/usr/local"))))

However, to run mv src/emms-print-metadata /usr/local, I need root permission via sudo. Is there anyway to do this?

@Lodger Lodger added the support label Mar 23, 2021
@progfolio
Copy link
Contributor

Is the goal to run the command as root without any prompt for your password, or do you want to be prompted for your password?

@Lodger
Copy link
Author

Lodger commented Mar 24, 2021

ideally I would like to be prompted, but either way would be acceptable

@progfolio
Copy link
Contributor

:post-build commands can be arbitrary elisp or system processes. I haven't tried it, but you may be able to set up an askpass program and write a script which prompts for a password when you need it.

@raxod502
Copy link
Member

Yep, that would be the way to do it. straight.el won't be able to do a tty prompt (due to complications with how async processes work), so you'll need some additional configuration.

That said, might it be a better idea to reconfigure whatever dependency wants the EMMS stuff installed in /usr/local so that it can read the configuration out of your home directory instead? That seems like it could potentially be cleaner.

@Lodger
Copy link
Author

Lodger commented Apr 10, 2021

This was the perfect solution, didn't realize i could customize emms-info-libtag-program-name :p, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants