`which` isn't in POSIX and some Linux distributions (e.g. Debian,
Gentoo) are trying to remove it from their base installs. See
https://lwn.net/Articles/874049/.
If system's node is overriden by something in PATH, having NODE_DIR
empty will cause the script to still use node found in /bin/.
Only consider the first case if NODE_DIR is not empty.
By default FreeBSD does not have the Bourne-again shell (Bash)
installed. Therefore, the system fails to execute two ``find'' scripts
(etc/scripts/find-node and etc/scripts/find-yarn) running by the
Makefile within the `.node-bin` and `.yarn-bin` targets.
I see nothing Bash-specific in those scripts. Also I believe that
`[[ expression ]]` commands in those particular cases can be safely
replaced with the `test` built-in commands.
With these changes I can now run a local ``Compiler explorer'' instance
on FreeBSD.
Signed-off-by: Ruslan Garipov <ruslanngaripov@gmail.com>