2021-12-01.replace-usage-of-which.patch 694 B

12345678910111213141516171819202122232425
  1. Subject: Replace usage of which(1)
  2. Author: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
  3. Date: 2021-12-01
  4. Forwarded: https://github.com/latchset/jose/issues/108
  5. --- a/tests/jose-jwe-enc
  6. +++ b/tests/jose-jwe-enc
  7. @@ -15,7 +15,7 @@
  8. jwe=$tmpdir/jwe
  9. jqopt() {
  10. - if ! which jq >/dev/null 2>&1; then
  11. + if ! command -v jq >/dev/null 2>&1; then
  12. echo "$3"
  13. else
  14. jq -r "if $2 | type | . = \"string\" then $2 else error(\"\") end" < $1
  15. @@ -23,7 +23,7 @@
  16. }
  17. jqbopt() {
  18. - if ! which jq >/dev/null 2>&1; then
  19. + if ! command -v jq >/dev/null 2>&1; then
  20. echo "$4"
  21. else
  22. jq -r "if $2 | type | . = \"string\" then $2 else error(\"\") end" < $1 \