jquery/jquery — pull request #809 by runejuhl (2012-06-03 20:07:18+00:00)
Title: Updated Makefile to support installations where "which" returns multiple matches

Some distributions place the nodejs executable in both /usr/bin/node and /usr/bin/nodejs, resulting in the line ```JS_ENGINE ?= `which node nodejs` ``` at line 8 in the `Makefile` to consist of multiple lines. This causes `Make` to fail with the following messages:

$ make
/bin/sh: 1: test: /usr/bin/node: unexpected operator
You must have NodeJS installed in order to minify jQuery.
/bin/sh: 1: test: /usr/bin/node: unexpected operator
You must have NodeJS installed in order to test jQuery against JSHint.
/bin/sh: 1: test: /usr/bin/node: unexpected operator
You must have NodeJS installed in order to size jQuery.
jQuery build complete.

The patch pipes the output from `which` into `head -n1` to select the first result.
This has been tested on Debian Wheezy.