Skip to content

Commit 1e269f4

Browse files
pabs3tadfisher
authored andcommitted
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.
1 parent af92be5 commit 1e269f4

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

default.nix

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
, gnupg
99
, pass
1010
, shellcheck
11-
, which
1211
}:
1312

1413
stdenv.mkDerivation {
@@ -33,7 +32,7 @@ stdenv.mkDerivation {
3332
doCheck = true;
3433

3534
patchPhase = ''
36-
sed -i -e 's|OATH=\$(which oathtool)|OATH=${oathToolkit}/bin/oathtool|' otp.bash
35+
sed -i -e 's|OATH=\$(command -v oathtool)|OATH=${oathToolkit}/bin/oathtool|' otp.bash
3736
'';
3837

3938
checkPhase = ''

otp.bash

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
# []
1818

1919
VERSION="1.1.2"
20-
OATH=$(which oathtool)
21-
OTPTOOL=$(which otptool)
20+
OATH=$(command -v oathtool)
21+
OTPTOOL=$(command -v otptool)
2222

2323
if [[ $PASSAGE == 1 ]]; then
2424
EXT="age"

0 commit comments

Comments
 (0)