-
Notifications
You must be signed in to change notification settings - Fork 1
Description
This issue pertains to ads-github-tools-0.3.5 (released 2022-10-26).
The various programs in the ads-github-tools attempt to provide informative error messages when things go wrong. One example of this is when needed programs (either internal or external) are not available for some reason -- the ads-github-tools programs attempt to verify the availability of all other needed programs before attempting any real work. However, in this case, the error messages are not always correct because they always indicate that a missing tool was not found "on PATH".
For example, of the following three ads-github-whoami invocations, the error message is only correct for the first one (there really is not any program named jqX on $PATH):
$ type -a jq
jq is /usr/bin/jq
jq is /bin/jq
$ type -a jqX
bash: type: jqX: not found
$ JQ=jqX ads-github-whoami
ads-github-whoami (error): was unable to locate "jqX" on PATH; bailing out
$ JQ=bin/jq ads-github-whoami
ads-github-whoami (error): was unable to locate "bin/jq" on PATH; bailing out
$ JQ=/does/not/exist/jq ads-github-whoami
ads-github-whoami (error): was unable to locate "/does/not/exist/jq" on PATH; bailing out
The second invocation (JQ=bin/jq ads-github-whoami) does not perform a search for the jq program on $PATH, but rather looks for it specifcally at the location bin/jq (that is, in a bin/ subdirectory of the current working directory).
Similarly, the third invocation (JQ=/does/not/exist/jq ads-github-whoami) looks for the jq program only at the explicitly indicated location. Again, it does not search for the program on $PATH, so the error message is misleading.
The programs in the ads-github-tools project should be updated to have all such error messages corrected. It is useful to tell the user that a search on $PATH failed to locate a given tool, if that is the case. Otherwise we just want to tell the user that the tool was not found at the specific location.
[For the avoidance of doubt, the above situation affects most (or all) of the programs provided by the ads-github-tools project. The specific program ads-github-whoami was used as a representative example.]