[PATCH] makefile: run Rust tests if cargo is installed

Yuya Nishihara yuya at tcha.org
Thu Aug 22 08:50:32 EDT 2019


On Thu, 22 Aug 2019 21:41:40 +0900, Yuya Nishihara wrote:
> On Thu, 22 Aug 2019 07:47:30 +0200, Raphaël Gomès wrote:
> > I'm not sure I agree, checking for execute this way seems very common 
> > and looks more semantic to me.
> 
> [ -x path ] is valid, but why do you want to test the result of
> `command -v cmd` again? It maybe an empty string if the cmd doesn't exist.

According to the doc, we can simply test the exit code.

  if command -v cargo >/dev/null 2>&1; then

https://pubs.opengroup.org/onlinepubs/9699919799/utilities/command.html


More information about the Mercurial-devel mailing list