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
, pass
, shellcheck
, which
}:
stdenv.mkDerivation {
@@ -33,7 +32,7 @@ stdenv.mkDerivation {
doCheck = true;
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 = ''

View File

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