tadfisher / pass-otp

A pass extension for managing one-time-password (OTP) tokens
GNU General Public License v3.0
1.26k stars 86 forks source link

pass otp not working anymore (which: command not found) #176

Open juipeltje opened 1 year ago

juipeltje commented 1 year ago

hello,

i was trying to generate an otp code and it gives the following error:

/usr/lib/password-store/extensions/otp.bash: line 20: which: command not found Failed to generate OTP code: oathtool is not installed.

it seems to be complaining about this line in otp.bash:

OATH=$(which oathtool)

i have no clue what's going wrong here though, i checked and oathtool is definitely installed. i am also using this setup on a different computer running the same package versions and it works fine over there, the otp.bash also looks exactly the same on that second computer but still for some reason, on my main pc it gives the error. does anyone know what's going on?

31239899 commented 1 year ago

@juipeltje

I know this may be late enough that it's not useful, but the error you're seeing is from bash saying that it can't find the which command. The best/easiest solution is to install which. You could also replace it with command -v (which is a Bash built-in command) in the script.

juipeltje commented 1 year ago

thank you for your reply! yeah i ended up asking the same question on reddit and found out that i had to install which. it was working before so for some weird reason my system has deleted the package at some point i guess. i felt kinda silly after i realized that it was because of the which package and had nothing to do with pass otp, so i deleted my issue here (or at least i thought i did?). i'm not very familiar with github yet so maybe i did something wrong there.