mmstick / cargo-deb

A cargo subcommand that generates Debian packages from information in Cargo.toml
615 stars 50 forks source link

Don't use sudo if running --install as root #149

Open evanjs opened 4 years ago

evanjs commented 4 years ago

I was recently debugging an issue with an application that utilizes cargo-deb. For a while, I was hung up on a simple I/O error: No such file or directory (os error 2).

Eventually... I navigated to the install_deb definition (again), and realized it uses sudo... which was not present on my test system.

I noticed this was discussed before, but did not seem to be implemented.

I think it might be helpful if we either implement the linked solution, and if not, notify the user that sudo was the file that was not found.

cc @clarfonthey who requested the initial change and @kornelski who implemented it.

kornelski commented 4 years ago

Yeah, that's a good idea. Can you make a PR?