Use command -v instead of which for finding programs

which is non-standard and prints warnings when programs are not installed,
but pass-otp already handles programs not being installed properly.

Still use which in the tests because it usefully prints the $PATH too.
This commit is contained in:
Paul Wise
2023-05-12 14:20:45 +08:00
committed by Tad Fisher
parent af92be564c
commit 1e269f4d6e
2 changed files with 3 additions and 4 deletions

View File

@@ -8,7 +8,6 @@
, gnupg , gnupg
, pass , pass
, shellcheck , shellcheck
, which
}: }:
stdenv.mkDerivation { stdenv.mkDerivation {
@@ -33,7 +32,7 @@ stdenv.mkDerivation {
doCheck = true; doCheck = true;
patchPhase = '' patchPhase = ''
sed -i -e 's|OATH=\$(which oathtool)|OATH=${oathToolkit}/bin/oathtool|' otp.bash sed -i -e 's|OATH=\$(command -v oathtool)|OATH=${oathToolkit}/bin/oathtool|' otp.bash
''; '';
checkPhase = '' checkPhase = ''

View File

@@ -17,8 +17,8 @@
# [] # []
VERSION="1.1.2" VERSION="1.1.2"
OATH=$(which oathtool) OATH=$(command -v oathtool)
OTPTOOL=$(which otptool) OTPTOOL=$(command -v otptool)
if [[ $PASSAGE == 1 ]]; then if [[ $PASSAGE == 1 ]]; then
EXT="age" EXT="age"