diff --git a/scripts/openai-usage.rcsh b/scripts/openai-usage.rcsh index fa5ab06..38f0428 100755 --- a/scripts/openai-usage.rcsh +++ b/scripts/openai-usage.rcsh @@ -26,7 +26,7 @@ if(! test -r $auth) { echo Run 'codex login' first. >[1=2] exit 1 } -if(! command -v curl >/dev/null >[2=1] || ! command -v jq >/dev/null >[2=1]) { +if(! whatis curl >/dev/null >[2=1] || ! whatis jq >/dev/null >[2=1]) { echo openai-usage.rcsh requires curl and jq. >[1=2] exit 1 } @@ -36,7 +36,7 @@ token_expired=`{jq -r ' | split(".")[1] | @base64d | fromjson | .exp <= now ' $auth} if(~ $token_expired true) { - if(! command -v codex >/dev/null >[2=1]) { + if(! whatis codex >/dev/null >[2=1]) { echo 'The Codex login has expired. Run `codex login` to refresh it.' >[1=2] exit 1 } @@ -54,7 +54,7 @@ response=`{mktemp -t openai-usage.XXXXXX} terminal_columns=$COLUMNS if(~ $terminal_columns ()) terminal_columns=80 -if(test -t 1 && command -v tput >/dev/null >[2=1]) +if(test -t 1 && whatis tput >/dev/null >[2=1]) terminal_columns=`{tput cols} fn cleanup { diff --git a/scripts/pushover.rcsh b/scripts/pushover.rcsh index a5f6e41..81feea4 100755 --- a/scripts/pushover.rcsh +++ b/scripts/pushover.rcsh @@ -63,7 +63,7 @@ fn validate_device { if (~ $1 ()) { return } - if (! which jq >/dev/null >[2=1]) { + if (! whatis jq >/dev/null >[2=1]) { invalid 'Cannot validate device without jq in PATH' } ok=`{curl -sS --max-time 5 \