not-a-feature / wd_fw_update

Updates the firmware of Western Digital SSDs on Ubuntu / Linux Mint.
https://wd-fw-update.readthedocs.io
GNU General Public License v3.0
22 stars 3 forks source link

Dependency check fails if depencency is installed to /usr/sbin #5

Open csnover opened 6 months ago

csnover commented 6 months ago

Looking for nvme dependency that is installed to /usr/sbin using which does not work since PATH does not include that directory for regular users on at least Debian. Instead, just try running the command, and then report an error if it fails with a hint that the dependency is maybe missing (or, do like the shell script did and just have users escalate privileges themselves).

not-a-feature commented 6 months ago

Having directly escalated privileges instead of using those only for the required commands is a bad practice.

But just running the command could be a option. The which approach was used as it was primarily developed for Linux Mint / Ubuntu where this works fine.